Smoothing regularization for a generative neural network

ABSTRACT

A style-based generative network architecture enables scale-specific control of synthesized output data, such as images. During training, the style-based generative neural network (generator neural network) includes a mapping network and a synthesis network. During prediction, the mapping network may be omitted, replicated, or evaluated several times. The synthesis network may be used to generate highly varied, high-quality output data with a wide variety of attributes. For example, when used to generate images of people&#39;s faces, the attributes that may vary are age, ethnicity, camera viewpoint, pose, face shape, eyeglasses, colors (eyes, hair, etc.), hair style, lighting, background, etc. Depending on the task, generated output data may include images, audio, video, three-dimensional (3D) objects, text, etc.

CLAIM OF PRIORITY

This application is a continuation-in-part of U.S. patent applicationSer. No. 16/418,317 titled “A Style-Based Architecture For GenerativeNeural Networks,” filed May 21, 2019 which claims the benefit of U.S.Provisional Application No. 62/767,417 titled “A Style-BasedArchitecture For Generative Neural Networks,” filed Nov. 14, 2018 andU.S. Provisional Application No. 62/767,985 titled “A Style-BasedArchitecture For Generative Neural Networks,” filed Nov. 15, 2018, theentire contents of these applications is incorporated herein byreference. This application also claims the benefit of U.S. ProvisionalApplication No. 62/990,012 titled “A Style-Based Architecture ForGenerative Neural Network for Improved Image Quality,” filed Mar. 16,2020, the entire contents of which is incorporated herein by reference.

TECHNICAL FIELD

The present invention relates to neural networks, and in particular, toa generator architecture for synthesizing data using scale-specificcontrols.

BACKGROUND

The resolution and quality of images produced by generative adversarialnetworks (GAN) has improved recently. Yet GANs continue to operate asblack boxes, and despite recent efforts, the understanding of variousaspects of the image synthesis process, e.g., the origin of stochasticfeatures, is still lacking. The properties of the latent space are alsopoorly understood, and the commonly demonstrated latent spaceinterpolations provide no quantitative way to compare different GANsagainst each other. There is a need for addressing these issues and/orother issues associated with the prior art.

SUMMARY

A style-based generative network architecture enables scale-specificcontrol of synthesized output data, such as images. During training, thestyle-based generative neural network (generator neural network)includes a mapping network and a synthesis network. During prediction,the mapping network may be omitted, replicated, or evaluated severaltimes. The synthesis network may be used to generate highly varied,high-quality output data with a wide variety of attributes. For example,when used to generate images of people's faces, the attributes that mayvary are age, ethnicity, camera viewpoint, pose, face shape, eyeglasses,colors (eyes, hair, etc.), hair style, lighting, background, etc.Depending on the task, generated output data may include images, audio,video, three-dimensional (3D) objects, text, etc.

A method, computer readable medium, and system are disclosed forsynthesizing output data using a mapping neural network and a synthesisneural network. A latent code defined in an input space is processed bythe mapping neural network to produce an intermediate latent codedefined in an intermediate latent space. The intermediate latent code isconverted into a first style signal. The first style signal is appliedat a first layer of the synthesis neural network to modify firstintermediate data according to the first style signal to producemodified first intermediate data. In an embodiment, the intermediatelatent code is a vector that is converted into the first style signalvia an affine transformation. The modified first intermediate data isprocessed to produce second intermediate data and a second style signalis applied at a second layer of the synthesis neural network to modifythe second intermediate data, according to the second style signal, toproduce second modified intermediate data. In an embodiment, theintermediate latent code is a combination of the first and second stylesignals and a portion of the intermediate latent code is extracted toproduce the first and/or second style signal. In an embodiment, theintermediate latent code is converted into the second style signal viaan affine transformation. In an embodiment, a second latent code definedin the input space is processed by the mapping neural network to producea second intermediate latent code defined in the intermediate latentspace and the second intermediate latent code is converted into thesecond style signal. In an embodiment, the modified first intermediatedata is processed by subsequent layers, such as a 3×3 convolutionallayer, to produce the second intermediate data. The second intermediatedata is processed to produce output data comprising contentcorresponding to the second intermediate data.

A method, computer readable medium, and system are disclosed forsynthesizing output data using a synthesis neural network. A first setof spatial noise is applied at a first layer of the synthesis neuralnetwork to generate modified first intermediate data comprising contentcorresponding to the first intermediate data that is modified based onthe first set of spatial noise. The modified first intermediate data isprocessed to produce second intermediate data and a second set ofspatial noise is applied at a second layer of the synthesis neuralnetwork to generate modified second intermediate data comprising contentcorresponding to the second intermediate data that is modified based onthe second set of spatial noise. The modified second intermediate datais processed to produce output data comprising content corresponding tothe second intermediate data.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A illustrates a block diagram of a style-based generator system,in accordance with an embodiment.

FIG. 1B illustrates images generated by the style-based generatorsystem, in accordance with an embodiment.

FIG. 1C illustrates a flowchart of a method for style-based generation,in accordance with an embodiment.

FIG. 2A illustrates a block diagram of the mapping neural network shownin FIG. 1A, in accordance with an embodiment.

FIG. 2B illustrates a block diagram of the synthesis neural networkshown in FIG. 1A, in accordance with an embodiment.

FIG. 2C illustrates a flowchart of a method for applying spatial noiseusing the style-based generator system, in accordance with anembodiment.

FIG. 2D illustrates a block diagram of a GAN system, in accordance withan embodiment.

FIG. 3 illustrates a parallel processing unit, in accordance with anembodiment.

FIG. 4A illustrates a general processing cluster within the parallelprocessing unit of FIG. 3 , in accordance with an embodiment.

FIG. 4B illustrates a memory partition unit of the parallel processingunit of FIG. 3 , in accordance with an embodiment.

FIG. 5A illustrates the streaming multi-processor of FIG. 4A, inaccordance with an embodiment.

FIG. 5B is a conceptual diagram of a processing system implemented usingthe PPU of FIG. 3 , in accordance with an embodiment.

FIG. 5C illustrates an exemplary system in which the variousarchitecture and/or functionality of the various previous embodimentsmay be implemented.

FIG. 5D illustrates components of an exemplary system that can be usedto train and utilize machine learning, for use in implementing someembodiments of the present disclosure.

FIG. 6A illustrates artifacts in images generated by the style-basedgenerator system, in accordance with an embodiment.

FIG. 6B illustrates a block diagram of the processing block shown inFIG. 2B, in accordance with an embodiment.

FIG. 6C illustrates a block diagram of a style block, for use inimplementing some embodiments of the present disclosure.

FIG. 6D illustrates a block diagram of another style block, for use inimplementing some embodiments of the present disclosure.

FIG. 6E illustrates a flowchart of a method for demodulating weightsapplied by a generator neural network, in accordance with an embodiment.

FIG. 6F illustrates images and feature maps generated using demodulatedweights, in accordance with an embodiment.

FIG. 7A illustrates images generated by the style-based generator systemthat have high perceptual path length (PPL) scores, in accordance withan embodiment.

FIG. 7B illustrates images generated using by the style-based generatorsystem that have low PPL scores, in accordance with an embodiment.

FIG. 7C illustrates a graph of the PPL scores for a set of images, inaccordance with an embodiment.

FIG. 7D illustrates a graph of PPL scores for a set of images generatedwhen smoothing regularization is used, in accordance with an embodiment.

FIG. 7E illustrates a conceptual diagram of paths withoutregularization, in accordance with an embodiment.

FIG. 7F illustrates a conceptual diagram of paths with regularization,in accordance with an embodiment.

FIG. 8A illustrates a block diagram of a synthesis neural networkimplemented using the style block of FIG. 6D, for use in implementingsome embodiments of the present disclosure.

FIG. 8B illustrates a block diagram of a generator neural networktraining system, in accordance with an embodiment.

FIG. 8C illustrates a flowchart of a method for smoothing regularizationfor use in a generator neural network, in accordance with an embodiment.

DETAILED DESCRIPTION

A style-based generative network architecture enables scale-specificcontrol of the synthesized output. A style-based generator systemincludes a mapping network and a synthesis network. Conceptually, in anembodiment, feature maps (containing spatially varying informationrepresenting content of the output data, where each feature map is onechannel of intermediate activations) generated by different layers ofthe synthesis network are modified based on style control signalsprovided by the mapping network. The style control signals for differentlayers of the synthesis network may be generated from the same ordifferent latent codes. A latent code may be a random N-dimensionalvector drawn from e.g. a Gaussian distribution. The style controlsignals for different layers of the synthesis network may be generatedfrom the same or different mapping networks. Additionally, spatial noisemay be injected into each layer of the synthesis network.

FIG. 1A illustrates a block diagram of a style-based generator system100, in accordance with an embodiment. The style-based generator system100 includes a mapping neural network 110, a style conversion unit 115,and a synthesis neural network 140. After the synthesis neural network140 is trained, the synthesis neural network 140 may be deployed withoutthe mapping neural network 110 when the intermediate latent code(s)and/or the style signals produced by the style conversion unit 115 arepre-computed. In an embodiment, additional style conversion units 115may be included to convert the intermediate latent code generated by themapping neural network 110 into a second style signal or to convert adifferent intermediate latent code into the second style signal. One ormore additional mapping neural networks 110 may be included in thestyle-based generator system 100 to generate additional intermediatelatent codes from the latent code or additional latent codes.

The style-based generator system 100 may be implemented by a program,custom circuitry, or by a combination of custom circuitry and a program.For example, the style-based generator system 100 may be implementedusing a GPU (graphics processing unit), CPU (central processing unit),or any processor capable of performing the operations described herein.Furthermore, persons of ordinary skill in the art will understand thatany system that performs the operations of the style-based generatorsystem 100 is within the scope and spirit of embodiments of the presentinvention.

Conventionally, a latent code is provided to a generator through aninput layer, such as the first layer of a feedforward neural network. Incontrast, in an embodiment, instead of receiving the latent code, thesynthesis neural network 140 starts from a learned constant and thelatent code is input to the mapping neural network 110. In anembodiment, the first intermediate data is the learned constant. Given alatent code z in the input latent space

, a non-linear mapping network ƒ:

→

first produces intermediate latent code w∈

. The mapping neural network 110 may be configured to implement thenon-linear mapping network. In an embodiment, the dimensions of inputand output activations in the input latent space

and the intermediate latent space

are equal (e.g., 512). In an embodiment, the mapping function ƒ isimplemented using an 8-layer MLP (multilayer perceptron, i.e., a neuralnetwork consisting of only fully-connected layers).

While the conventional generator only feeds the latent code though theinput layer of the generator, the mapping neural network 110 insteadmaps the input latent code z to the intermediate latent space

to produce the intermediate latent code w. The style conversion unit 115converts the intermediate latent code w into a first style signal. Oneor more intermediate latent codes w are converted into spatiallyinvariant styles including the first style signal and a second stylesignal. In contrast with conventional style transfer techniques, thespatially invariant styles are computed from a vector, namely theintermediate latent code w, instead of from an example image. The one ormore intermediate latent codes w may be generated by one or more mappingneural networks 110 for one or more respective latent codes z. Thesynthesis neural network 140 processes the first intermediate data(e.g., a learned constant encoded as a feature map) according to thestyle signals, for example, increasing density of the first intermediatedata from 4×4 to 8×8 and continuing until the output data density isreached.

In an embodiment, the style conversion unit 115 performs an affinetransformation. The style conversion unit 115 may be trained to learnthe affine transformation during training of the synthesis neuralnetwork 140. The first style signal controls operations at a first layer120 of the synthesis neural network 140 to produce modified firstintermediate data. In an embodiment, the first style signal controls anadaptive instance normalization (AdaIN) operation within the first layer120 of the synthesis network 140. In an embodiment, the AdaIN operationreceives a set of content feature maps and a style signal and modifiesthe first-order statistics (i.e., the “style”) of the content featuremaps to match first-order statistics defined by the style signal. Themodified first intermediate data output by the first layer 120 isprocessed by processing layer(s) 125 to generate second intermediatedata. In an embodiment, the processing layer(s) 125 include a 3×3convolution layer. In an embodiment, the processing layer(s) 125 includea 3×3 convolution layer followed by an AdaIN operation that receives anadditional style signal, not explicitly shown in FIG. 1A.

The second intermediate data is input to a second layer 130 of thesynthesis neural network 140. The second style signal controlsoperations at the second layer 130 to produce modified secondintermediate data. In an embodiment, the first style signal modifies afirst attribute encoded in the first intermediate data and the secondstyle signal modifies a second attribute encoded in the firstintermediate data and the second intermediate data. For example, thefirst intermediate data is coarse data compared with the secondintermediate data and the first style is transferred to coarse featuremaps at the first layer 120 while the second style is transferred tohigher density feature maps at the second layer 130.

In an embodiment, the second layer 130 up-samples the secondintermediate data and includes a 3×3 convolution layer followed by anAdaIN operation. In an embodiment, the second style signal controls anAdaIN operation within the second layer 130 of the synthesis network140. The modified second intermediate data output by the second layer130 is processed by processing layer(s) 135 to generate output dataincluding content corresponding to the second intermediate data. In anembodiment, multiple (e.g., 32, 48, 64, 96, etc.) channels of featuresin the modified second intermediate data are converted into the outputdata that is encoded as color channels (e.g., red, green, blue).

In an embodiment, the processing layer(s) 135 includes a 3×3 convolutionlayer. In an embodiment, the output data is an image including firstattributes corresponding to a first scale and second attributescorresponding to a second scale, where the first scale is coarsercompared with the second scale. The first scale may correspond to ascale of the feature maps processed by the first layer 120 and thesecond scale may correspond to a scale of the feature maps processed bythe second layer 130. Accordingly, the first style signal modifies thefirst attributes at the first scale and the second style signal modifiesthe second attributes at the second scale.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay be implemented, per the desires of the user. It should be stronglynoted that the following information is set forth for illustrativepurposes and should not be construed as limiting in any manner. Any ofthe following features may be optionally incorporated with or withoutthe exclusion of other features described.

FIG. 1B illustrates images generated by the style-based generator system100, in accordance with an embodiment. The images are generated in 1024²resolution. In other embodiments, the images can be generated at adifferent resolution. Two different latent codes are used to control thestyles of images generated by the style-based generator system 100.Specifically, a first portion of the styles are produced by the mappingneural network 110 and a style conversion unit 115 from the “source”latent codes in the top row. A second portion of the styles are producedby the same or an additional mapping neural network 110 and acorresponding style conversion unit 115 from the “destination” latentcodes in the leftmost column. The style-based generator system 100starts from a learned constant input at the synthesis neural network 140and adjusts the “style” of the image at each convolution layer based onthe latent code, therefore directly controlling the strength of imageattributes, encoded in feature maps, at different scales. In otherwords, a given set of styles from “source” data is copied to“destination” data. Thus, the copied styles (coarse, middle, or fine)are taken from the “source” data while all the other styles are kept thesame as in the “destination” data.

The first portion of styles (destination) are applied by the synthesisneural network 140 to process the learned constant with a first subsetof the first portion of styles replaced with a corresponding secondsubset of the second portion of the styles (source). In an embodiment,the learned constant is a 4×4×512 constant tensor. In the second, third,and fourth rows of images in FIG. 1B, the second portion of the styles(source) replaces the first portion of the styles (destination) atcoarse layers of the synthesis neural network 140. In an embodiment, thecoarse layers correspond to coarse spatial densities 4²-8². In anembodiment, high-level attributes such as pose, general hair style, faceshape, and eyeglasses are copied from the source, while otherattributes, such as all colors (eyes, hair, lighting) and finer facialfeatures of the destination are retained.

In the fifth and sixth rows of images in FIG. 1B, second portion of thestyles (source) replaces the first portion of the styles (destination)at middle layers of the synthesis neural network 140. In an embodiment,the middle layers correspond to spatial densities of 16²-32². Smallerscale facial features, hair style, eyes open/closed are inherited fromthe source, while the pose, general face shape, and eyeglasses from thedestination are preserved. Finally, in the last row of images in FIG.1B, the second portion of the styles (source) replaces the first portionof the styles (destination) at high density (fine) layers of thesynthesis neural network 140. In an embodiment, the fine layerscorrespond to spatial densities of 64²-1024². Using the styles from thesecond portion of the styles (source) for the fine layers inherits thecolor scheme and microstructure from the source while preserving thepose and general face shape from the destination.

The architecture of the style-based generator system 100 enables controlof the image synthesis via scale-specific modifications to the styles.The mapping network 110 and affine transformations performed by thestyle conversion unit 115 can be viewed as a way to draw samples foreach style from a learned distribution, and the synthesis network 140provides a mechanism to generate a novel image based on a collection ofstyles. The effects of each style are localized in the synthesis network140, i.e., modifying a specific subset of the styles can be expected toaffect only certain attributes of the image.

Using style signals from at least two different latent codes, as shownin FIG. 1B, is referred to as style mixing or mixing regularization.Style mixing during training decorrelates neighboring styles and enablesmore fine-grained control over the generated imagery. In an embodiment,during training a given percentage of images are generated using tworandom latent codes instead of one. When generating such an image, arandom location (e.g., crossover point) in the synthesis neural network140 may be selected where processing switches from using style signalsgenerated using a first latent code to style signals generated using asecond latent code. In an embodiment, two latent codes z₁, z₂ areprocessed by the mapping neural network 110, and the correspondingintermediate latent codes w₁, w₂ control the styles so that w₁ appliesbefore the crossover point and w₂ after the crossover point. The mixingregularization technique prevents the synthesis neural network 140 fromassuming that adjacent styles are correlated.

TABLE 1 shows how enabling mixing regularization during training mayimprove localization of the styles considerably, indicated by improved(lower is better) Fréchet inception distances (FIDs) in scenarios wheremultiple latent codes are mixed at test time. The images shown in FIG.1B are examples of images synthesized by mixing two latent codes atvarious scales. Each subset of styles controls meaningful high-levelattributes of the image.

TABLE 1 FIDs for different mixing regularization ratios Number of latentcodes Mixing ratio (test time) (training time) 1 2 3 4  0% 4.42 8.2212.88 17.41 50% 4.41 6.10 8.71 11.61 90% 4.40 5.11 6.88 9.03 100%  4.835.17 6.63 8.40

The mixing ratio indicates that percentage of training examples forwhich mixing regularization is enabled. A maximum of four differentlatent codes were randomly selected during test time and the crossoverpoints between the different latent codes were also randomly selected.Mixing regularization improves the tolerance to these adverse operationssignificantly.

As confirmed by the FIDs, the average quality of the images generated bythe style-based generator system 100 is high, and even accessories suchas eyeglasses and hats are successfully synthesized. For the imagesshown in FIG. 1B, sampling from the extreme regions of

is avoided by using the so-called truncation trick that can be performedin

instead of

. Note that the style-based generator system 100 may be implemented toenable application of the truncation selectively to low resolutionsonly, so that high-resolution details are not affected.

Considering the distribution of training data, areas of low density arepoorly represented and thus likely to be difficult for the style-basedgenerator system 100 to learn. Non-uniform distributions of trainingdata present a significant open problem in all generative modelingtechniques. However, it is known that drawing latent vectors from atruncated or otherwise shrunk sampling space tends to improve averageimage quality, although some amount of variation is lost. In anembodiment, to improve training of the style-based generator system 100,a center of mass of

is computed as w=

_(z˜P(z))[ƒ(z)]. In the case of one dataset of human faces (e.g., FFHQ,Flickr-Faces-HQ), the point represents a sort of an average face (ψ=0).The deviation of a given w is scaled down from the center asw′=w+ψ(w−w), where ψ<1. In conventional generative modeling systems,only a subset of the neural networks are amenable to such truncation,even when orthogonal regularization is used, truncation in W space seemsto work reliably even without changes to the loss function.

FIG. 1C illustrates a flowchart of a method 150 for style-basedgeneration, in accordance with an embodiment. The method 150 may beperformed by a program, custom circuitry, or by a combination of customcircuitry and a program. For example, the method 150 may be executed bya GPU (graphics processing unit), CPU (central processing unit), or anyprocessor capable of performing the operations of the style-basedgenerator system 100. Furthermore, persons of ordinary skill in the artwill understand that any system that performs method 150 is within thescope and spirit of embodiments of the present invention.

At step 155, the mapping neural network 110 processes a latent codedefined in an input space, to produce an intermediate latent codedefined in an intermediate latent space. At step 160, the intermediatelatent code is converted into a first style signal by the styleconversion unit 115. At step 165, the first style signal is applied at afirst layer 120 of the synthesis neural network 140 to modify the firstintermediate data according to the first style signal to producemodified first intermediate data. At step 170, the modified firstintermediate data is processed by the processing layer(s) 125 to producethe second intermediate data. At step 175, a second style signal isapplied at the second layer 130 of the synthesis neural network 140 tomodify the second intermediate data according to the second style signalto produce modified second intermediate data. At step 180, the modifiedsecond intermediate data is processed by the processing layer(s) 135 toproduce output data including content corresponding to the secondintermediate data.

There are various definitions for disentanglement, but a common goal isa latent space that consists of linear subspaces, each of which controlsone factor of variation. However, the sampling probability of eachcombination of factors in the latent space

needs to match the corresponding density in the training data.

A major benefit of the style-based generator system 100 is that theintermediate latent space

does not have to support sampling according to any fixed distribution;the sampling density for the style-based generator system 100 is inducedby the learned piecewise continuous mapping ƒ(z). The mapping can beadapted to “unwarp”

so that the factors of variation become more linear. The style-basedgenerator system 100 may naturally tend to unwarp

, as it should be easier to generate realistic images based on adisentangled representation than based on an entangled representation.As such, the training may yield a less entangled

in an unsupervised setting, i.e., when the factors of variation are notknown in advance.

FIG. 2A illustrates a block diagram of the mapping neural network 110shown in FIG. 1A, in accordance with an embodiment. A distribution ofthe training data may be missing a combination of attributes, such as,children wearing glasses. A distribution of the factors of variation inthe combination of glasses and age becomes more linear in theintermediate latent space

compared with the latent space

.

In an embodiment, the mapping neural network 110 includes anormalization layer 205 and multiple fully-connected layers 210. In anembodiment, eight fully-connected layers 210 are coupled in sequence toproduce the intermediate latent code. Parameters (e.g., weights) of themapping neural network 110 are learned during training and theparameters are used to process the input latent codes when thestyle-based generator system 100 is deployed to generate the outputdata. In an embodiment, the mapping neural network 110 generates one ormore intermediate latent codes that are used by the synthesis neuralnetwork 140 at a later time to generate the output data.

There are many attributes in human portraits that can be regarded asstochastic, such as the exact placement of hairs, stubble, freckles, orskin pores. Any of these can be randomized without affecting aperception of the image as long as the randomizations follow the correctdistribution. The artificial omission of noise when generating imagesleads to images with a featureless “painterly” look. In particular, whengenerating human portraits, coarse noise may cause large-scale curlingof hair and appearance of larger background features, while the finenoise may bring out the finer curls of hair, finer background detail,and skin pores.

A conventional generator may only generate stochastic variation based onthe input to the neural network, as provided through the input layer.During the training, the conventional generator may be forced to learnto generate spatially-varying pseudorandom numbers from earlieractivations whenever the pseudorandom numbers are needed. In otherwords, pseudorandom number generation is not intentionally built intothe conventional generator. Instead, the generation of pseudorandomnumbers emerges on its own during training in order for the conventionalgenerator to satisfy the training objective. Generating the pseudorandomnumbers consumes neural network capacity and hiding the periodicity ofgenerated signal is difficult—and not always successful, as evidenced bycommonly seen repetitive patterns in generated images. In contrast,style-based generator system 100 may be configured to avoid theselimitations by adding per-pixel noise after each convolution.

In an embodiment, the style-based generator system 100 is configuredwith a direct means to generate stochastic detail by introducingexplicit noise inputs. In an embodiment, the noise inputs aresingle-channel images consisting of uncorrelated Gaussian noise, and adedicated noise image is input to one or more layers of the synthesisnetwork 140. The noise image may be broadcast to all feature maps usinglearned per-feature scaling factors and then added to the output of thecorresponding convolution.

FIG. 2B illustrates a block diagram of the synthesis neural network 140shown in FIG. 1A, in accordance with an embodiment. The synthesis neuralnetwork 140 includes a first processing block 200 and a secondprocessing block 230. In an embodiment, the processing block 200processes 4×4 resolution feature maps and the processing block 230processes 8×8 resolution feature maps. One or more additional processingblocks may be included in the synthesis neural network 140 after theprocessing blocks 200 and 230, before them, and/or between them.

The first processing block 200 receives the first intermediate data,first spatial noise, and second spatial noise. In an embodiment, thefirst spatial noise is scaled by a learned per-channel scaling factorbefore being combined with (e.g., added to) the first intermediate data.In an embodiment, the first spatial noise, second spatial noise, thirdspatial noise, and fourth spatial noise is independent per-pixelGaussian noise.

The first processing block 200 also receives the first style signal andthe second style signal. As previously explained, the style signals maybe obtained by processing the intermediate latent code according to alearned affine transform. Learned affine transformations specialize w tostyles y=(y_(s), y_(b)) that control adaptive instance normalization(AdaIN) operations implemented by the modules 220 in the synthesisneural network 140. Compared to more general feature transforms, AdaINis particularly well suited for implementation in the style-basedgenerator system 100 due to its efficiency and compact representation.

The AdaIN operation is defined

$\begin{matrix}{{{AdaIN}\left( {x_{i},y} \right)} = {{y_{s,i}\frac{x_{i} - {\mu\left( x_{i} \right)}}{\sigma\left( x_{i} \right)}} + y_{b,i}}} & (1)\end{matrix}$where each feature map x_(i), is normalized separately, and then scaledand biased using the corresponding scalar components from style y. Thus,the dimensionality of y is twice the number of feature maps compared tothe input of the layer. In an embodiment, a dimension of the stylesignal is a multiple of a number of feature maps in the layer at whichthe style signal is applied. In contrast with conventional styletransfer, the spatially invariant style y is computed from vector winstead of an example image.

The effects of each style signal are localized in the synthesis neuralnetwork 140, i.e., modifying a specific subset of the style signals canbe expected to affect only certain attributes of an image represented bythe output data. To see the reason for the localization, consider howthe AdaIN operation (Eq. 1) implemented by the module 220 firstnormalizes each channel to zero mean and unit variance, and only thenapplies scales and biases based on the style signal. The new per-channelstatistics, as dictated by the style, modify the relative importance offeatures for the subsequent convolution operation, but the newper-channel statistics do not depend on the original statistics becauseof the normalization. Thus, each style signal controls only apre-defined number of convolution(s) 225 before being overridden by thenext AdaIN operation. In an embodiment, scaled spatial noise is added tothe features after each convolution and before processing by anothermodule 220.

Each module 220 may be followed by a convolution layer 225. In anembodiment, the convolution layer 225 applies a 3×3 convolution kernelto the input. Within the processing block 200, second intermediate dataoutput by the convolution layer 225 is combined with the second spatialnoise and input to a second module 220 that applies the second stylesignal to generate an output of the processing block 200. In anembodiment, the second spatial noise is scaled by a learned per-channelscaling factor before being combined with (e.g., added to) the secondintermediate data.

The processing block 230 receives feature maps output by the processingblock 200 and the feature maps are up-sampled by an up-sampling layer235. In an embodiment 4×4 feature maps are up-sampled by the up-samplinglayer 235 to produce 8×8 feature maps. The up-sampled feature maps areinput to another convolution layer 225 to produce third intermediatedata. Within the processing block 230, the third intermediate data iscombined with the third spatial noise and input to a third module 220that applies the third style signal via an AdaIN operation. In anembodiment, the third spatial noise is scaled by a learned per-channelscaling factor before being combined with (e.g., added to) the thirdintermediate data. The output of the third module 220 is processed byanother convolution layer 225 to produce fourth intermediate data. Thefourth intermediate data is combined with the fourth spatial noise andinput to a fourth module 220 that applies the fourth style signal via anAdaIN operation. In an embodiment, the fourth spatial noise is scaled bya learned per-channel scaling factor before being combined with (e.g.,added to) the fourth intermediate data.

In an embodiment, a resolution of the output data is 1024² and thesynthesis neural network 140 includes 18 layers—two for eachpower-of-two resolution (4²-1024²). The output of the last layer of thesynthesis neural network 140 may be converted to RGB using a separate1×1 convolution. In an embodiment, the synthesis neural network 140 hasa total of 26.2M trainable parameters, compared to 23.1 M in aconventional generator with the same number of layers and feature maps.

Introducing spatial noise affects only the stochastic aspects of theoutput data, leaving the overall composition and high-level attributessuch as identity intact. Separate noise inputs to the synthesis neuralnetwork 140 enables the application of stochastic variation to differentsubsets of layers. Applying a spatial noise input to a particular layerof the synthesis neural network 140 leads to stochastic variation at ascale that matches the scale of the particular layer.

The effect of noise appears tightly localized in the synthesis neuralnetwork 140. At any point in the synthesis neural network 140, there ispressure to introduce new content as soon as possible, and the easiestway for the synthesis neural network 140 to create stochastic variationis to rely on the spatial noise inputs. A fresh set of spatial noise isavailable for each layer in the synthesis neural network 140, and thusthere is no incentive to generate the stochastic effects from earlieractivations, leading to a localized effect. Therefore, the noise affectsonly inconsequential stochastic variation (differently combed hair,beard, etc.). In contrast, changes to the style signals have globaleffects (changing pose, identity, etc.).

In the synthesis neural network 140, when the output data is an image,the style signals affect the entire image because complete feature mapsare scaled and biased with the same values. Therefore, global effectssuch as pose, lighting, or background style can be controlledcoherently. Meanwhile, the spatial noise is added independently to eachpixel and is thus ideally suited for controlling stochastic variation.If the synthesis neural network 140 tried to control, e.g., pose usingthe noise, that would lead to spatially inconsistent decisions thatwould be penalized during training. Thus, the synthesis neural network140 learns to use the global and local channels appropriately, withoutexplicit guidance.

FIG. 2C illustrates a flowchart of a method 250 for applying spatialnoise using the style-based generator system 100, in accordance with anembodiment. The method 250 may be performed by a program, customcircuitry, or by a combination of custom circuitry and a program. Forexample, the method 250 may be executed by a GPU (graphics processingunit), CPU (central processing unit), or any processor capable ofperforming the operations of the style-based generator system 100.Furthermore, persons of ordinary skill in the art will understand thatany system that performs method 250 is within the scope and spirit ofembodiments of the present invention.

At step 255, a first set of spatial noise is applied at a first layer ofthe synthesis neural network 140 to generate the first intermediate datacomprising content corresponding to source data that is modified basedon the first set of spatial noise. In an embodiment, the source data isthe first intermediate data and the first layer is a layer including themodule 220 and/or the convolution layer 225. At step 258, the modifiedfirst intermediate data is processed by the processing layer(s) 125 toproduce the second intermediate data. At step 260, a second set ofspatial noise is applied at a second layer of the synthesis neuralnetwork 140 to generate second intermediate data comprising contentcorresponding to the first intermediate data that is modified based onthe second set of spatial noise. In an embodiment, the firstintermediate data is modified by at least the module 220 to produce thesecond intermediate data. At step 265, the second intermediate data isprocessed to produce output data including content corresponding to thesecond intermediate data. In an embodiment, the second intermediate datais processed by another module 220 and the block 230 to produce theoutput data.

Noise may be injected into the layers of the synthesis neural network140 to cause synthesis of stochastic variations at a scale correspondingto the layer. Importantly, the noise should be injected during bothtraining and generation. Additionally, during generation, the strengthof the noise may be modified to further control the “look” of the outputdata. Providing style signals instead of directly inputting the latentcode into the synthesis neural network 140 in combination with noiseinjected directly into the synthesis neural network 140, leads toautomatic, unsupervised separation of high-level attributes (e.g., pose,identity) from stochastic variation (e.g., freckles, hair) in thegenerated images, and enables intuitive scale-specific mixing andinterpolation operations.

In particular, the style signals directly adjust the strength of imageattributes at different scales in the synthesis neural network 140.During generation, the style signals can be used to modify selectedimage attributes. Additionally, during training, the mapping neuralnetwork 110 may be configured to perform style mixing regularization toimprove localization of the styles.

The mapping neural network 110 embeds the input latent code into theintermediate latent space, which has a profound effect on how thefactors of variation are represented in the synthesis neural network140. The input latent space follows the probability density of thetraining data, and this likely leads to some degree of unavoidableentanglement. The intermediate latent space is free from thatrestriction and is therefore allowed to be disentangled. Compared to aconventional generator architecture, the style-based generator system100 admits a more linear, less entangled representation of differentfactors of variation. In an embodiment, replacing a conventionalgenerator with the style-based generator may not require modifying anyother component of the training framework (loss function, discriminator,optimization method, or the like).

The style-based generative neural network 100 may be trained using e.g.the GAN (generative adversarial networks), VAE (variational autoencoder)framework, flow-based framework, or the like. FIG. 2D illustrates ablock diagram of the GAN 270 training framework, in accordance with anembodiment. The GAN 270 may be implemented by a program, customcircuitry, or by a combination of custom circuitry and a program. Forexample, the GAN 270 may be implemented using a GPU, CPU, or anyprocessor capable of performing the operations described herein.Furthermore, persons of ordinary skill in the art will understand thatany system that performs the operations of the GAN 270 is within thescope and spirit of embodiments of the present invention.

The GAN 270 includes a generator, such as the style-based generatorsystem 100, a discriminator (neural network) 275, and a training lossunit 280. The topologies of both the generator 110 and discriminator 275may be modified during training. The GAN 270 may operate in anunsupervised setting or in a conditional setting. The style-basedgenerator system 100 receives input data (e.g., at least one latent codeand/or noise inputs) and produces output data. Depending on the task,the output data may be an image, audio, video, or other types of data(configuration setting). The discriminator 275 is an adaptive lossfunction that is used during training of the style-based generatorsystem 100. The style-based generator system 100 and discriminator 275are trained simultaneously using a training dataset that includesexample output data that the output data produced by the style-basedgenerator system 100 should be consistent with. The style-basedgenerator system 100 generates output data in response to the input dataand the discriminator 275 determines if the output data appears similarto the example output data included in the training data. Based on thedetermination, parameters of the discriminator 275 and/or thestyle-based generative neural network 100 are adjusted.

In the unsupervised setting, the discriminator 275 outputs a continuousvalue indicating how closely the output data matches the example outputdata. For example, in an embodiment, the discriminator 275 outputs afirst training stimulus (e.g., high value) when the output data isdetermined to match the example output data and a second trainingstimulus (e.g., low value) when the output data is determined to notmatch the example output data. The training loss unit 280 adjustsparameters (weights) of the GAN 270 based on the output of thediscriminator 275. When the style-based generator system 100 is trainedfor a specific task, such as generating images of human faces, thediscriminator outputs a high value when the output data is an image of ahuman face. The output data generated by the style-based generatorsystem 100 is not required to be identical to the example output datafor the discriminator 275 to determine the output data matches theexample output data. In the context of the following description, thediscriminator 275 determines that the output data matches the exampleoutput data when the output data is similar to any of the example outputdata.

In the conditional setting, the input of the style-based generativeneural network 100 may include other data, such as an image, aclassification label, segmentation contours, and other (additional)types of data (distribution, audio, etc.). The additional data may bespecified in addition to the random latent code, or the additional datamay replace the random latent code altogether. The training dataset mayinclude input/output data pairs, and the task of the discriminator 275may be to determine if the output of the style-based generative neuralnetwork 100 appears consistent with the input, based on the exampleinput/output pairs that the discriminator 275 has seen in the trainingdata.

Parallel Processing Architecture

FIG. 3 illustrates a parallel processing unit (PPU) 300, in accordancewith an embodiment. The PPU 400 may be used to implement the style-basedgenerator system 100. The PPU 400 may be used to implement one or moreof the mapping neural network 110, style conversion unit 115, synthesisneural network 140, generative adversarial network 270, style block 640,style block 645, and synthesis neural network 840. In an embodiment, aprocessor such as the PPU 400 may be configured to implement a neuralnetwork model. The neural network model may be implemented as softwareinstructions executed by the processor or, in other embodiments, theprocessor can include a matrix of hardware elements configured toprocess a set of inputs (e.g., electrical signals representing values)to generate a set of outputs, which can represent activations of theneural network model. In yet other embodiments, the neural network modelcan be implemented as a combination of software instructions andprocessing performed by a matrix of hardware elements. Implementing theneural network model can include determining a set of parameters for theneural network model through, e.g., supervised or unsupervised trainingof the neural network model as well as, or in the alternative,performing inference using the set of parameters to process novel setsof inputs.

In an embodiment, the PPU 300 is a multi-threaded processor that isimplemented on one or more integrated circuit devices. The PPU 300 is alatency hiding architecture designed to process many threads inparallel. A thread (i.e., a thread of execution) is an instantiation ofa set of instructions configured to be executed by the PPU 300. In anembodiment, the PPU 300 is a graphics processing unit (GPU) configuredto implement a graphics rendering pipeline for processingthree-dimensional (3D) graphics data in order to generatetwo-dimensional (2D) image data for display on a display device such asa liquid crystal display (LCD) device. In another embodiment, the PPU300 is configured to implement the neural network system 100. In otherembodiments, the PPU 300 may be utilized for performing general-purposecomputations. While one exemplary parallel processor is provided hereinfor illustrative purposes, it should be strongly noted that suchprocessor is set forth for illustrative purposes only, and that anyprocessor may be employed to supplement and/or substitute for the same.

One or more PPUs 300 may be configured to accelerate thousands of HighPerformance Computing (HPC), data center, and machine learningapplications. The PPU 300 may be configured to accelerate numerous deeplearning systems and applications including autonomous vehicleplatforms, deep learning, high-accuracy speech, image, and textrecognition systems, intelligent video analytics, molecular simulations,drug discovery, disease diagnosis, weather forecasting, big dataanalytics, astronomy, molecular dynamics simulation, financial modeling,robotics, factory automation, real-time language translation, onlinesearch optimizations, and personalized user recommendations, and thelike.

As shown in FIG. 3 , the PPU 300 includes an Input/Output (I/O) unit305, a front end unit 315, a scheduler unit 320, a work distributionunit 325, a hub 330, a crossbar (Xbar) 370, one or more generalprocessing clusters (GPCs) 350, and one or more partition units 380. ThePPU 300 may be connected to a host processor or other PPUs 300 via oneor more high-speed NVLink 310 interconnect. The PPU 300 may be connectedto a host processor or other peripheral devices via an interconnect 302.The PPU 300 may also be connected to a local memory 304 comprising anumber of memory devices. In an embodiment, the local memory maycomprise a number of dynamic random access memory (DRAM) devices. TheDRAM devices may be configured as a high-bandwidth memory (HBM)subsystem, with multiple DRAM dies stacked within each device.

The NVLink 310 interconnect enables systems to scale and include one ormore PPUs 300 combined with one or more CPUs, supports cache coherencebetween the PPUs 300 and CPUs, and CPU mastering. Data and/or commandsmay be transmitted by the NVLink 310 through the hub 330 to/from otherunits of the PPU 300 such as one or more copy engines, a video encoder,a video decoder, a power management unit, etc. (not explicitly shown).The NVLink 310 is described in more detail in conjunction with FIG. 5B.

The I/O unit 305 is configured to transmit and receive communications(i.e., commands, data, etc.) from a host processor (not shown) over theinterconnect 302. The I/O unit 305 may communicate with the hostprocessor directly via the interconnect 302 or through one or moreintermediate devices such as a memory bridge. In an embodiment, the I/Ounit 305 may communicate with one or more other processors, such as oneor more the PPUs 300 via the interconnect 302. In an embodiment, the I/Ounit 305 implements a Peripheral Component Interconnect Express (PCIe)interface for communications over a PCIe bus and the interconnect 302 isa PCIe bus. In alternative embodiments, the I/O unit 305 may implementother types of well-known interfaces for communicating with externaldevices.

The I/O unit 305 decodes packets received via the interconnect 302. Inan embodiment, the packets represent commands configured to cause thePPU 300 to perform various operations. The I/O unit 305 transmits thedecoded commands to various other units of the PPU 300 as the commandsmay specify. For example, some commands may be transmitted to the frontend unit 315. Other commands may be transmitted to the hub 330 or otherunits of the PPU 300 such as one or more copy engines, a video encoder,a video decoder, a power management unit, etc. (not explicitly shown).In other words, the I/O unit 305 is configured to route communicationsbetween and among the various logical units of the PPU 300.

In an embodiment, a program executed by the host processor encodes acommand stream in a buffer that provides workloads to the PPU 300 forprocessing. A workload may comprise several instructions and data to beprocessed by those instructions. The buffer is a region in a memory thatis accessible (i.e., read/write) by both the host processor and the PPU300. For example, the I/O unit 305 may be configured to access thebuffer in a system memory connected to the interconnect 302 via memoryrequests transmitted over the interconnect 302. In an embodiment, thehost processor writes the command stream to the buffer and thentransmits a pointer to the start of the command stream to the PPU 300.The front end unit 315 receives pointers to one or more command streams.The front end unit 315 manages the one or more streams, reading commandsfrom the streams and forwarding commands to the various units of the PPU300.

The front end unit 315 is coupled to a scheduler unit 320 thatconfigures the various GPCs 350 to process tasks defined by the one ormore streams. The scheduler unit 320 is configured to track stateinformation related to the various tasks managed by the scheduler unit320. The state may indicate which GPC 350 a task is assigned to, whetherthe task is active or inactive, a priority level associated with thetask, and so forth. The scheduler unit 320 manages the execution of aplurality of tasks on the one or more GPCs 350.

The scheduler unit 320 is coupled to a work distribution unit 325 thatis configured to dispatch tasks for execution on the GPCs 350. The workdistribution unit 325 may track a number of scheduled tasks receivedfrom the scheduler unit 320. In an embodiment, the work distributionunit 325 manages a pending task pool and an active task pool for each ofthe GPCs 350. The pending task pool may comprise a number of slots(e.g., 32 slots) that contain tasks assigned to be processed by aparticular GPC 350. The active task pool may comprise a number of slots(e.g., 4 slots) for tasks that are actively being processed by the GPCs350. As a GPC 350 finishes the execution of a task, that task is evictedfrom the active task pool for the GPC 350 and one of the other tasksfrom the pending task pool is selected and scheduled for execution onthe GPC 350. If an active task has been idle on the GPC 350, such aswhile waiting for a data dependency to be resolved, then the active taskmay be evicted from the GPC 350 and returned to the pending task poolwhile another task in the pending task pool is selected and scheduledfor execution on the GPC 350.

The work distribution unit 325 communicates with the one or more GPCs350 via XBar 370. The XBar 370 is an interconnect network that couplesmany of the units of the PPU 300 to other units of the PPU 300. Forexample, the XBar 370 may be configured to couple the work distributionunit 325 to a particular GPC 350. Although not shown explicitly, one ormore other units of the PPU 300 may also be connected to the XBar 370via the hub 330.

The tasks are managed by the scheduler unit 320 and dispatched to a GPC350 by the work distribution unit 325. The GPC 350 is configured toprocess the task and generate results. The results may be consumed byother tasks within the GPC 350, routed to a different GPC 350 via theXBar 370, or stored in the memory 304. The results can be written to thememory 304 via the partition units 380, which implement a memoryinterface for reading and writing data to/from the memory 304. Theresults can be transmitted to another PPU 300 or CPU via the NVLink 310.In an embodiment, the PPU 300 includes a number U of partition units 380that is equal to the number of separate and distinct memory devices ofthe memory 304 coupled to the PPU 300. A partition unit 380 will bedescribed in more detail below in conjunction with FIG. 4B.

In an embodiment, a host processor executes a driver kernel thatimplements an application programming interface (API) that enables oneor more applications executing on the host processor to scheduleoperations for execution on the PPU 300. In an embodiment, multiplecompute applications are simultaneously executed by the PPU 300 and thePPU 300 provides isolation, quality of service (QoS), and independentaddress spaces for the multiple compute applications. An application maygenerate instructions (i.e., API calls) that cause the driver kernel togenerate one or more tasks for execution by the PPU 300. The driverkernel outputs tasks to one or more streams being processed by the PPU300. Each task may comprise one or more groups of related threads,referred to herein as a warp. In an embodiment, a warp comprises 32related threads that may be executed in parallel. Cooperating threadsmay refer to a plurality of threads including instructions to performthe task and that may exchange data through shared memory. Threads andcooperating threads are described in more detail in conjunction withFIG. 5A.

FIG. 4A illustrates a GPC 350 of the PPU 300 of FIG. 3 , in accordancewith an embodiment. As shown in FIG. 4A, each GPC 350 includes a numberof hardware units for processing tasks. In an embodiment, each GPC 350includes a pipeline manager 410, a pre-raster operations unit (PROP)415, a raster engine 425, a work distribution crossbar (WDX) 480, amemory management unit (MMU) 490, and one or more Data ProcessingClusters (DPCs) 420. It will be appreciated that the GPC 350 of FIG. 4Amay include other hardware units in lieu of or in addition to the unitsshown in FIG. 4A.

In an embodiment, the operation of the GPC 350 is controlled by thepipeline manager 410. The pipeline manager 410 manages the configurationof the one or more DPCs 420 for processing tasks allocated to the GPC350. In an embodiment, the pipeline manager 410 may configure at leastone of the one or more DPCs 420 to implement at least a portion of agraphics rendering pipeline. For example, a DPC 420 may be configured toexecute a vertex shader program on the programmable streamingmultiprocessor (SM) 440. The pipeline manager 410 may also be configuredto route packets received from the work distribution unit 325 to theappropriate logical units within the GPC 350. For example, some packetsmay be routed to fixed function hardware units in the PROP 415 and/orraster engine 425 while other packets may be routed to the DPCs 420 forprocessing by the primitive engine 435 or the SM 440. In an embodiment,the pipeline manager 410 may configure at least one of the one or moreDPCs 420 to implement a neural network model and/or a computingpipeline.

The PROP unit 415 is configured to route data generated by the rasterengine 425 and the DPCs 420 to a Raster Operations (ROP) unit, describedin more detail in conjunction with FIG. 4B. The PROP unit 415 may alsobe configured to perform optimizations for color blending, organizepixel data, perform address translations, and the like.

The raster engine 425 includes a number of fixed function hardware unitsconfigured to perform various raster operations. In an embodiment, theraster engine 425 includes a setup engine, a coarse raster engine, aculling engine, a clipping engine, a fine raster engine, and a tilecoalescing engine. The setup engine receives transformed vertices andgenerates plane equations associated with the geometric primitivedefined by the vertices. The plane equations are transmitted to thecoarse raster engine to generate coverage information (e.g., an x,ycoverage mask for a tile) for the primitive. The output of the coarseraster engine is transmitted to the culling engine where fragmentsassociated with the primitive that fail a z-test are culled, andtransmitted to a clipping engine where fragments lying outside a viewingfrustum are clipped. Those fragments that survive clipping and cullingmay be passed to the fine raster engine to generate attributes for thepixel fragments based on the plane equations generated by the setupengine. The output of the raster engine 425 comprises fragments to beprocessed, for example, by a fragment shader implemented within a DPC420.

Each DPC 420 included in the GPC 350 includes an M-Pipe Controller (MPC)430, a primitive engine 435, and one or more SMs 440. The MPC 430controls the operation of the DPC 420, routing packets received from thepipeline manager 410 to the appropriate units in the DPC 420. Forexample, packets associated with a vertex may be routed to the primitiveengine 435, which is configured to fetch vertex attributes associatedwith the vertex from the memory 304. In contrast, packets associatedwith a shader program may be transmitted to the SM 440.

The SM 440 comprises a programmable streaming processor that isconfigured to process tasks represented by a number of threads. Each SM440 is multi-threaded and configured to execute a plurality of threads(e.g., 32 threads) from a particular group of threads concurrently. Inan embodiment, the SM 440 implements a SIMD (Single-Instruction,Multiple-Data) architecture where each thread in a group of threads(i.e., a warp) is configured to process a different set of data based onthe same set of instructions. All threads in the group of threadsexecute the same instructions. In another embodiment, the SM 440implements a SIMT (Single-Instruction, Multiple Thread) architecturewhere each thread in a group of threads is configured to process adifferent set of data based on the same set of instructions, but whereindividual threads in the group of threads are allowed to diverge duringexecution. In an embodiment, a program counter, call stack, andexecution state is maintained for each warp, enabling concurrencybetween warps and serial execution within warps when threads within thewarp diverge. In another embodiment, a program counter, call stack, andexecution state is maintained for each individual thread, enabling equalconcurrency between all threads, within and between warps. Whenexecution state is maintained for each individual thread, threadsexecuting the same instructions may be converged and executed inparallel for maximum efficiency. The SM 440 will be described in moredetail below in conjunction with FIG. 5A.

The MMU 490 provides an interface between the GPC 350 and the partitionunit 380. The MMU 490 may provide translation of virtual addresses intophysical addresses, memory protection, and arbitration of memoryrequests. In an embodiment, the MMU 490 provides one or more translationlookaside buffers (TLBs) for performing translation of virtual addressesinto physical addresses in the memory 304.

FIG. 4B illustrates a memory partition unit 380 of the PPU 300 of FIG. 3, in accordance with an embodiment. As shown in FIG. 4B, the memorypartition unit 380 includes a Raster Operations (ROP) unit 450, a leveltwo (L2) cache 460, and a memory interface 470. The memory interface 470is coupled to the memory 304. Memory interface 470 may implement 32, 64,128, 1024-bit data buses, or the like, for high-speed data transfer. Inan embodiment, the PPU 300 incorporates U memory interfaces 470, onememory interface 470 per pair of partition units 380, where each pair ofpartition units 380 is connected to a corresponding memory device of thememory 304. For example, PPU 300 may be connected to up to Y memorydevices 304, such as high bandwidth memory stacks or graphicsdouble-data-rate, version 5, synchronous dynamic random access memory,or other types of persistent storage.

In an embodiment, the memory interface 470 implements an HBM2 memoryinterface and Y equals half U. In an embodiment, the HBM2 memory stacksare located on the same physical package as the PPU 300, providingsubstantial power and area savings compared with conventional GDDR5SDRAM systems. In an embodiment, each HBM2 stack includes four memorydies and Y equals 4, with HBM2 stack including two 128-bit channels perdie for a total of 8 channels and a data bus width of 1024 bits.

In an embodiment, the memory 304 supports Single-Error CorrectingDouble-Error Detecting (SECDED) Error Correction Code (ECC) to protectdata. ECC provides higher reliability for compute applications that aresensitive to data corruption. Reliability is especially important inlarge-scale cluster computing environments where PPUs 300 process verylarge datasets and/or run applications for extended periods.

In an embodiment, the PPU 300 implements a multi-level memory hierarchy.In an embodiment, the memory partition unit 380 supports a unifiedmemory to provide a single unified virtual address space for CPU and PPU300 memory, enabling data sharing between virtual memory systems. In anembodiment the frequency of accesses by a PPU 300 to memory located onother processors is traced to ensure that memory pages are moved to thephysical memory of the PPU 300 that is accessing the pages morefrequently. In an embodiment, the NVLink 310 supports addresstranslation services allowing the PPU 300 to directly access a CPU'spage tables and providing full access to CPU memory by the PPU 300.

In an embodiment, copy engines transfer data between multiple PPUs 300or between PPUs 300 and CPUs. The copy engines can generate page faultsfor addresses that are not mapped into the page tables. The memorypartition unit 380 can then service the page faults, mapping theaddresses into the page table, after which the copy engine can performthe transfer. In a conventional system, memory is pinned (i.e.,non-pageable) for multiple copy engine operations between multipleprocessors, substantially reducing the available memory. With hardwarepage faulting, addresses can be passed to the copy engines withoutworrying if the memory pages are resident, and the copy process istransparent.

Data from the memory 304 or other system memory may be fetched by thememory partition unit 380 and stored in the L2 cache 460, which islocated on-chip and is shared between the various GPCs 350. As shown,each memory partition unit 380 includes a portion of the L2 cache 460associated with a corresponding memory 304. Lower level caches may thenbe implemented in various units within the GPCs 350. For example, eachof the SMs 440 may implement a level one (L1) cache. The L1 cache isprivate memory that is dedicated to a particular SM 440. Data from theL2 cache 460 may be fetched and stored in each of the L1 caches forprocessing in the functional units of the SMs 440. The L2 cache 460 iscoupled to the memory interface 470 and the XBar 370.

The ROP unit 450 performs graphics raster operations related to pixelcolor, such as color compression, pixel blending, and the like. The ROPunit 450 also implements depth testing in conjunction with the rasterengine 425, receiving a depth for a sample location associated with apixel fragment from the culling engine of the raster engine 425. Thedepth is tested against a corresponding depth in a depth buffer for asample location associated with the fragment. If the fragment passes thedepth test for the sample location, then the ROP unit 450 updates thedepth buffer and transmits a result of the depth test to the rasterengine 425. It will be appreciated that the number of partition units380 may be different than the number of GPCs 350 and, therefore, eachROP unit 450 may be coupled to each of the GPCs 350. The ROP unit 450tracks packets received from the different GPCs 350 and determines whichGPC 350 that a result generated by the ROP unit 450 is routed to throughthe Xbar 370. Although the ROP unit 450 is included within the memorypartition unit 380 in FIG. 4B, in other embodiment, the ROP unit 450 maybe outside of the memory partition unit 380. For example, the ROP unit450 may reside in the GPC 350 or another unit.

FIG. 5A illustrates the streaming multi-processor 440 of FIG. 4A, inaccordance with an embodiment. As shown in FIG. 5A, the SM 440 includesan instruction cache 505, one or more scheduler units 510, a registerfile 520, one or more processing cores 550, one or more special functionunits (SFUs) 552, one or more load/store units (LSUs) 554, aninterconnect network 580, a shared memory/L1 cache 570.

As described above, the work distribution unit 325 dispatches tasks forexecution on the GPCs 350 of the PPU 300. The tasks are allocated to aparticular DPC 420 within a GPC 350 and, if the task is associated witha shader program, the task may be allocated to an SM 440. The schedulerunit 510 receives the tasks from the work distribution unit 325 andmanages instruction scheduling for one or more thread blocks assigned tothe SM 440. The scheduler unit 510 schedules thread blocks for executionas warps of parallel threads, where each thread block is allocated atleast one warp. In an embodiment, each warp executes 32 threads. Thescheduler unit 510 may manage a plurality of different thread blocks,allocating the warps to the different thread blocks and then dispatchinginstructions from the plurality of different cooperative groups to thevarious functional units (i.e., cores 550, SFUs 552, and LSUs 554)during each clock cycle.

Cooperative Groups is a programming model for organizing groups ofcommunicating threads that allows developers to express the granularityat which threads are communicating, enabling the expression of richer,more efficient parallel decompositions. Cooperative launch APIs supportsynchronization amongst thread blocks for the execution of parallelalgorithms. Conventional programming models provide a single, simpleconstruct for synchronizing cooperating threads: a barrier across allthreads of a thread block (i.e., the syncthreads( ) function). However,programmers would often like to define groups of threads at smaller thanthread block granularities and synchronize within the defined groups toenable greater performance, design flexibility, and software reuse inthe form of collective group-wide function interfaces.

Cooperative Groups enables programmers to define groups of threadsexplicitly at sub-block (i.e., as small as a single thread) andmulti-block granularities, and to perform collective operations such assynchronization on the threads in a cooperative group. The programmingmodel supports clean composition across software boundaries, so thatlibraries and utility functions can synchronize safely within theirlocal context without having to make assumptions about convergence.Cooperative Groups primitives enable new patterns of cooperativeparallelism, including producer-consumer parallelism, opportunisticparallelism, and global synchronization across an entire grid of threadblocks.

A dispatch unit 515 is configured to transmit instructions to one ormore of the functional units. In the embodiment, the scheduler unit 510includes two dispatch units 515 that enable two different instructionsfrom the same warp to be dispatched during each clock cycle. Inalternative embodiments, each scheduler unit 510 may include a singledispatch unit 515 or additional dispatch units 515.

Each SM 440 includes a register file 520 that provides a set ofregisters for the functional units of the SM 440. In an embodiment, theregister file 520 is divided between each of the functional units suchthat each functional unit is allocated a dedicated portion of theregister file 520. In another embodiment, the register file 520 isdivided between the different warps being executed by the SM 440. Theregister file 520 provides temporary storage for operands connected tothe data paths of the functional units.

Each SM 440 comprises L processing cores 550. In an embodiment, the SM440 includes a large number (e.g., 128, etc.) of distinct processingcores 550. Each core 550 may include a fully-pipelined,single-precision, double-precision, and/or mixed precision processingunit that includes a floating point arithmetic logic unit and an integerarithmetic logic unit. In an embodiment, the floating point arithmeticlogic units implement the IEEE 754-2008 standard for floating pointarithmetic. In an embodiment, the cores 550 include 64 single-precision(32-bit) floating point cores, 64 integer cores, 32 double-precision(64-bit) floating point cores, and 8 tensor cores.

Tensor cores configured to perform matrix operations, and, in anembodiment, one or more tensor cores are included in the cores 550. Inparticular, the tensor cores are configured to perform deep learningmatrix arithmetic, such as GEMM (matrix-matrix multiplication) forconvolution operations during neural network training and inferencing.In an embodiment, each tensor core operates on a 4×4 matrix and performsa matrix multiply and accumulate operation D=A×B+C, where A, B, C, and Dare 4×4 matrices.

In an embodiment, the matrix multiply inputs A and B may be integer,fixed-point, or floating point matrices, while the accumulation matricesC and D may be integer, fixed-point, or floating point matrices of equalor higher bitwidths. In an embodiment, tensor cores operate on one,four, or eight bit integer input data with 32-bit integer accumulation.The 8-bit integer matrix multiply requires 1024 operations and resultsin a full precision product that is then accumulated using 32-bitinteger addition with the other intermediate products for a 8×8×16matrix multiply. In an embodiment, tensor Cores operate on 16-bitfloating point input data with 32-bit floating point accumulation. The16-bit floating point multiply requires 64 operations and results in afull precision product that is then accumulated using 32-bit floatingpoint addition with the other intermediate products for a 4×4×4 matrixmultiply. In practice, Tensor Cores are used to perform much largertwo-dimensional or higher dimensional matrix operations, built up fromthese smaller elements. An API, such as CUDA 9 C++ API, exposesspecialized matrix load, matrix multiply and accumulate, and matrixstore operations to efficiently use Tensor Cores from a CUDA-C++program. At the CUDA level, the warp-level interface assumes 16×16 sizematrices spanning all 32 threads of the warp.

Each SM 440 also comprises M SFUs 552 that perform special functions(e.g., attribute evaluation, reciprocal square root, and the like). Inan embodiment, the SFUs 552 may include a tree traversal unit configuredto traverse a hierarchical tree data structure. In an embodiment, theSFUs 552 may include texture unit configured to perform texture mapfiltering operations. In an embodiment, the texture units are configuredto load texture maps (e.g., a 2D array of texels) from the memory 304and sample the texture maps to produce sampled texture values for use inshader programs executed by the SM 440. In an embodiment, the texturemaps are stored in the shared memory/L1 cache 470. The texture unitsimplement texture operations such as filtering operations using mip-maps(i.e., texture maps of varying levels of detail). In an embodiment, eachSM 340 includes two texture units.

Each SM 440 also comprises N LSUs 554 that implement load and storeoperations between the shared memory/L1 cache 570 and the register file520. Each SM 440 includes an interconnect network 580 that connects eachof the functional units to the register file 520 and the LSU 554 to theregister file 520, shared memory/L1 cache 570. In an embodiment, theinterconnect network 580 is a crossbar that can be configured to connectany of the functional units to any of the registers in the register file520 and connect the LSUs 554 to the register file and memory locationsin shared memory/L1 cache 570.

The shared memory/L1 cache 570 is an array of on-chip memory that allowsfor data storage and communication between the SM 440 and the primitiveengine 435 and between threads in the SM 440. In an embodiment, theshared memory/L1 cache 570 comprises 128 KB of storage capacity and isin the path from the SM 440 to the partition unit 380. The sharedmemory/L1 cache 570 can be used to cache reads and writes. One or moreof the shared memory/L1 cache 570, L2 cache 460, and memory 304 arebacking stores.

Combining data cache and shared memory functionality into a singlememory block provides the best overall performance for both types ofmemory accesses. The capacity is usable as a cache by programs that donot use shared memory. For example, if shared memory is configured touse half of the capacity, texture and load/store operations can use theremaining capacity. Integration within the shared memory/L1 cache 570enables the shared memory/L1 cache 570 to function as a high-throughputconduit for streaming data while simultaneously providing high-bandwidthand low-latency access to frequently reused data.

When configured for general purpose parallel computation, a simplerconfiguration can be used compared with graphics processing.Specifically, the fixed function graphics processing units shown in FIG.3 , are bypassed, creating a much simpler programming model. In thegeneral purpose parallel computation configuration, the workdistribution unit 325 assigns and distributes blocks of threads directlyto the DPCs 420. The threads in a block execute the same program, usinga unique thread ID in the calculation to ensure each thread generatesunique results, using the SM 440 to execute the program and performcalculations, shared memory/L1 cache 570 to communicate between threads,and the LSU 554 to read and write global memory through the sharedmemory/L1 cache 570 and the memory partition unit 380. When configuredfor general purpose parallel computation, the SM 440 can also writecommands that the scheduler unit 320 can use to launch new work on theDPCs 420.

The PPUs 300 may each include, and/or be configured to perform functionsof, one or more processing cores and/or components thereof, such asTensor Cores (TCs), Tensor Processing Units (TPUs), Pixel Visual Cores(PVCs), Ray Tracing (RT) Cores, Vision Processing Units (VPUs), GraphicsProcessing Clusters (GPCs), Texture Processing Clusters (TPCs),Streaming Multiprocessors (SMs), Tree Traversal Units (TTUs), ArtificialIntelligence Accelerators (AIAs), Deep Learning Accelerators (DLAs),Arithmetic-Logic Units (ALUs), Application-Specific Integrated Circuits(ASICs), Floating Point Units (FPUs), input/output (I/O) elements,peripheral component interconnect (PCI) or peripheral componentinterconnect express (PCIe) elements, and/or the like.

The PPU 300 may be included in a desktop computer, a laptop computer, atablet computer, servers, supercomputers, a smart-phone (e.g., awireless, hand-held device), personal digital assistant (PDA), a digitalcamera, a vehicle, a head mounted display, a hand-held electronicdevice, and the like. In an embodiment, the PPU 300 is embodied on asingle semiconductor substrate. In another embodiment, the PPU 300 isincluded in a system-on-a-chip (SoC) along with one or more otherdevices such as additional PPUs 300, the memory 304, a reducedinstruction set computer (RISC) CPU, a memory management unit (MMU), adigital-to-analog converter (DAC), and the like.

In an embodiment, the PPU 300 may be included on a graphics card thatincludes one or more memory devices. The graphics card may be configuredto interface with a PCIe slot on a motherboard of a desktop computer. Inyet another embodiment, the PPU 300 may be an integrated graphicsprocessing unit (iGPU) or parallel processor included in the chipset ofthe motherboard. In yet another embodiment, the PPU 300 may be realizedin reconfigurable hardware. In yet another embodiment, parts of the PPU300 may be realized in reconfigurable hardware.

Exemplary Computing System

Systems with multiple GPUs and CPUs are used in a variety of industriesas developers expose and leverage more parallelism in applications suchas artificial intelligence computing. High-performance GPU-acceleratedsystems with tens to many thousands of compute nodes are deployed indata centers, research facilities, and supercomputers to solve everlarger problems. As the number of processing devices within thehigh-performance systems increases, the communication and data transfermechanisms need to scale to support the increased bandwidth.

FIG. 5B is a conceptual diagram of a processing system 500 implementedusing the PPU 300 of FIG. 3 , in accordance with an embodiment. Theexemplary system 565 may be configured to implement the method 150 shownin FIG. 1C and/or the method 250 shown in FIG. 2C. The processing system500 includes a CPU 530, switch 510, and multiple PPUs 300, andrespective memories 304. The NVLink 310 provides high-speedcommunication links between each of the PPUs 300. Although a particularnumber of NVLink 310 and interconnect 302 connections are illustrated inFIG. 5B, the number of connections to each PPU 300 and the CPU 530 mayvary. The switch 510 interfaces between the interconnect 302 and the CPU530. The PPUs 300, memories 304, and NVLinks 310 may be situated on asingle semiconductor platform to form a parallel processing module 525.In an embodiment, the switch 510 supports two or more protocols tointerface between various different connections and/or links.

In another embodiment (not shown), the NVLink 310 provides one or morehigh-speed communication links between each of the PPUs 300 and the CPU530 and the switch 510 interfaces between the interconnect 302 and eachof the PPUs 300. The PPUs 300, memories 304, and interconnect 302 may besituated on a single semiconductor platform to form a parallelprocessing module 525. In yet another embodiment (not shown), theinterconnect 302 provides one or more communication links between eachof the PPUs 300 and the CPU 530 and the switch 510 interfaces betweeneach of the PPUs 300 using the NVLink 310 to provide one or morehigh-speed communication links between the PPUs 300. In anotherembodiment (not shown), the NVLink 310 provides one or more high-speedcommunication links between the PPUs 300 and the CPU 530 through theswitch 510. In yet another embodiment (not shown), the interconnect 302provides one or more communication links between each of the PPUs 300directly. One or more of the NVLink 310 high-speed communication linksmay be implemented as a physical NVLink interconnect or either anon-chip or on-die interconnect using the same protocol as the NVLink310.

In the context of the present description, a single semiconductorplatform may refer to a sole unitary semiconductor-based integratedcircuit fabricated on a die or chip. It should be noted that the termsingle semiconductor platform may also refer to multi-chip modules withincreased connectivity which simulate on-chip operation and makesubstantial improvements over utilizing a conventional busimplementation. Of course, the various circuits or devices may also besituated separately or in various combinations of semiconductorplatforms per the desires of the user. Alternately, the parallelprocessing module 525 may be implemented as a circuit board substrateand each of the PPUs 300 and/or memories 304 may be packaged devices. Inan embodiment, the CPU 530, switch 510, and the parallel processingmodule 525 are situated on a single semiconductor platform.

In an embodiment, the signaling rate of each NVLink 310 is 20 to 25Gigabits/second and each PPU 300 includes six NVLink 310 interfaces (asshown in FIG. 5B, five NVLink 310 interfaces are included for each PPU300). Each NVLink 310 provides a data transfer rate of 25Gigabytes/second in each direction, with six links providing 300Gigabytes/second. The NVLinks 310 can be used exclusively for PPU-to-PPUcommunication as shown in FIG. 5B, or some combination of PPU-to-PPU andPPU-to-CPU, when the CPU 530 also includes one or more NVLink 310interfaces.

In an embodiment, the NVLink 310 allows direct load/store/atomic accessfrom the CPU 530 to each PPU's 300 memory 304. In an embodiment, theNVLink 310 supports coherency operations, allowing data read from thememories 304 to be stored in the cache hierarchy of the CPU 530,reducing cache access latency for the CPU 530. In an embodiment, theNVLink 310 includes support for Address Translation Services (ATS),allowing the PPU 300 to directly access page tables within the CPU 530.One or more of the NVLinks 310 may also be configured to operate in alow-power mode.

FIG. 5C illustrates an exemplary system 565 in which the variousarchitecture and/or functionality of the various previous embodimentsmay be implemented. The exemplary system 565 may be configured toimplement the method 150 shown in FIG. 1C and/or the method 250 shown inFIG. 2C.

As shown, a system 565 is provided including at least one centralprocessing unit 530 that is connected to a communication bus 575. Thecommunication bus 575 may directly or indirectly couple one or more ofthe following devices: main memory 540, network interface 535, CPU(s)530, display device(s) 545, input device(s) 560, switch 510, andparallel processing system 525. The communication bus 575 may beimplemented using any suitable protocol and may represent one or morelinks or busses, such as an address bus, a data bus, a control bus, or acombination thereof. The communication bus 575 may include one or morebus or link types, such as an industry standard architecture (ISA) bus,an extended industry standard architecture (EISA) bus, a videoelectronics standards association (VESA) bus, a peripheral componentinterconnect (PCI) bus, a peripheral component interconnect express(PCIe) bus, HyperTransport, and/or another type of bus or link. In someembodiments, there are direct connections between components. As anexample, the CPU(s) 530 may be directly connected to the main memory540. Further, the CPU(s) 530 may be directly connected to the parallelprocessing system 525. Where there is direct, or point-to-pointconnection between components, the communication bus 575 may include aPCIe link to carry out the connection. In these examples, a PCI bus neednot be included in the system 565.

Although the various blocks of FIG. 5C are shown as connected via thecommunication bus 575 with lines, this is not intended to be limitingand is for clarity only. For example, in some embodiments, apresentation component, such as display device(s) 545, may be consideredan I/O component, such as input device(s) 560 (e.g., if the display is atouch screen). As another example, the CPU(s) 530 and/or parallelprocessing system 525 may include memory (e.g., the main memory 540 maybe representative of a storage device in addition to the parallelprocessing system 525, the CPUs 530, and/or other components). In otherwords, the computing device of FIG. 5C is merely illustrative.Distinction is not made between such categories as “workstation,”“server,” “laptop,” “desktop,” “tablet,” “client device,” “mobiledevice,” “hand-held device,” “game console,” “electronic control unit(ECU),” “virtual reality system,” and/or other device or system types,as all are contemplated within the scope of the computing device of FIG.5C.

The system 565 also includes a main memory 540. Control logic (software)and data are stored in the main memory 540 which may take the form of avariety of computer-readable media. The computer-readable media may beany available media that may be accessed by the system 565. Thecomputer-readable media may include both volatile and nonvolatile media,and removable and non-removable media. By way of example, and notlimitation, the computer-readable media may comprise computer-storagemedia and communication media.

The computer-storage media may include both volatile and nonvolatilemedia and/or removable and non-removable media implemented in any methodor technology for storage of information such as computer-readableinstructions, data structures, program modules, and/or other data types.For example, the main memory 540 may store computer-readableinstructions (e.g., that represent a program(s) and/or a programelement(s), such as an operating system. Computer-storage media mayinclude, but is not limited to, RAM, ROM, EEPROM, flash memory or othermemory technology, CD-ROM, digital versatile disks (DVD) or otheroptical disk storage, magnetic cassettes, magnetic tape, magnetic diskstorage or other magnetic storage devices, or any other medium which maybe used to store the desired information and which may be accessed bysystem 565. As used herein, computer storage media does not comprisesignals per se.

The computer storage media may embody computer-readable instructions,data structures, program modules, and/or other data types in a modulateddata signal such as a carrier wave or other transport mechanism andincludes any information delivery media. The term “modulated datasignal” may refer to a signal that has one or more of itscharacteristics set or changed in such a manner as to encode informationin the signal. By way of example, and not limitation, the computerstorage media may include wired media such as a wired network ordirect-wired connection, and wireless media such as acoustic, RF,infrared and other wireless media. Combinations of any of the aboveshould also be included within the scope of computer-readable media.

Computer programs, when executed, enable the system 565 to performvarious functions. The CPU(s) 530 may be configured to execute at leastsome of the computer-readable instructions to control one or morecomponents of the system 565 to perform one or more of the methodsand/or processes described herein. The CPU(s) 530 may each include oneor more cores (e.g., one, two, four, eight, twenty-eight, seventy-two,etc.) that are capable of handling a multitude of software threadssimultaneously. The CPU(s) 530 may include any type of processor, andmay include different types of processors depending on the type ofsystem 565 implemented (e.g., processors with fewer cores for mobiledevices and processors with more cores for servers). For example,depending on the type of system 565, the processor may be an AdvancedRISC Machines (ARM) processor implemented using Reduced Instruction SetComputing (RISC) or an x86 processor implemented using ComplexInstruction Set Computing (CISC). The system 565 may include one or moreCPUs 530 in addition to one or more microprocessors or supplementaryco-processors, such as math co-processors.

In addition to or alternatively from the CPU(s) 530, the parallelprocessing module 525 may be configured to execute at least some of thecomputer-readable instructions to control one or more components of thesystem 565 to perform one or more of the methods and/or processesdescribed herein. The parallel processing module 525 may be used by thesystem 565 to render graphics (e.g., 3D graphics) or perform generalpurpose computations. For example, the parallel processing module 525may be used for General-Purpose computing on GPUs (GPGPU). Inembodiments, the CPU(s) 530 and/or the parallel processing module 525may discretely or jointly perform any combination of the methods,processes and/or portions thereof.

The system 565 also includes input device(s) 560, the parallelprocessing system 525, and display device(s) 545. The display device(s)545 may include a display (e.g., a monitor, a touch screen, a televisionscreen, a heads-up-display (HUD), other display types, or a combinationthereof), speakers, and/or other presentation components. The displaydevice(s) 545 may receive data from other components (e.g., the parallelprocessing system 525, the CPU(s) 530, etc.), and output the data (e.g.,as an image, video, sound, etc.).

The network interface 535 may enable the system 565 to be logicallycoupled to other devices including the input devices 560, the displaydevice(s) 545, and/or other components, some of which may be built in to(e.g., integrated in) the system 565. Illustrative input devices 560include a microphone, mouse, keyboard, joystick, game pad, gamecontroller, satellite dish, scanner, printer, wireless device, etc. Theinput devices 560 may provide a natural user interface (NUI) thatprocesses air gestures, voice, or other physiological inputs generatedby a user. In some instances, inputs may be transmitted to anappropriate network element for further processing. An NUI may implementany combination of speech recognition, stylus recognition, facialrecognition, biometric recognition, gesture recognition both on screenand adjacent to the screen, air gestures, head and eye tracking, andtouch recognition (as described in more detail below) associated with adisplay of the system 565. The system 565 may be include depth cameras,such as stereoscopic camera systems, infrared camera systems, RGB camerasystems, touchscreen technology, and combinations of these, for gesturedetection and recognition. Additionally, the system 565 may includeaccelerometers or gyroscopes (e.g., as part of an inertia measurementunit (IMU)) that enable detection of motion. In some examples, theoutput of the accelerometers or gyroscopes may be used by the system 565to render immersive augmented reality or virtual reality.

Further, the system 565 may be coupled to a network (e.g., atelecommunications network, local area network (LAN), wireless network,wide area network (WAN) such as the Internet, peer-to-peer network,cable network, or the like) through a network interface 535 forcommunication purposes. The system 565 may be included within adistributed network and/or cloud computing environment.

The network interface 535 may include one or more receivers,transmitters, and/or transceivers that enable the system 565 tocommunicate with other computing devices via an electronic communicationnetwork, included wired and/or wireless communications. The networkinterface 535 may include components and functionality to enablecommunication over any of a number of different networks, such aswireless networks (e.g., Wi-Fi, Z-Wave, Bluetooth, Bluetooth LE, ZigBee,etc.), wired networks (e.g., communicating over Ethernet or InfiniBand),low-power wide-area networks (e.g., LoRaWAN, SigFox, etc.), and/or theInternet.

The system 565 may also include a secondary storage (not shown). Thesecondary storage includes, for example, a hard disk drive and/or aremovable storage drive, representing a floppy disk drive, a magnetictape drive, a compact disk drive, digital versatile disk (DVD) drive,recording device, universal serial bus (USB) flash memory. The removablestorage drive reads from and/or writes to a removable storage unit in awell-known manner. The system 565 may also include a hard-wired powersupply, a battery power supply, or a combination thereof (not shown).The power supply may provide power to the system 565 to enable thecomponents of the system 565 to operate.

Each of the foregoing modules and/or devices may even be situated on asingle semiconductor platform to form the system 565. Alternately, thevarious modules may also be situated separately or in variouscombinations of semiconductor platforms per the desires of the user.While various embodiments have been described above, it should beunderstood that they have been presented by way of example only, and notlimitation. Thus, the breadth and scope of a preferred embodiment shouldnot be limited by any of the above-described exemplary embodiments, butshould be defined only in accordance with the following claims and theirequivalents.

Example Network Environments

Network environments suitable for use in implementing embodiments of thedisclosure may include one or more client devices, servers, networkattached storage (NAS), other backend devices, and/or other devicetypes. The client devices, servers, and/or other device types (e.g.,each device) may be implemented on one or more instances of theprocessing system 500 of FIG. 5A and/or exemplary system 565 of FIG.5B—e.g., each device may include similar components, features, and/orfunctionality of the processing system 500 and/or exemplary system 565.

Components of a network environment may communicate with each other viaa network(s), which may be wired, wireless, or both. The network mayinclude multiple networks, or a network of networks. By way of example,the network may include one or more Wide Area Networks (WANs), one ormore Local Area Networks (LANs), one or more public networks such as theInternet and/or a public switched telephone network (PSTN), and/or oneor more private networks. Where the network includes a wirelesstelecommunications network, components such as a base station, acommunications tower, or even access points (as well as othercomponents) may provide wireless connectivity.

Compatible network environments may include one or more peer-to-peernetwork environments—in which case a server may not be included in anetwork environment—and one or more client-server networkenvironments—in which case one or more servers may be included in anetwork environment. In peer-to-peer network environments, functionalitydescribed herein with respect to a server(s) may be implemented on anynumber of client devices.

In at least one embodiment, a network environment may include one ormore cloud-based network environments, a distributed computingenvironment, a combination thereof, etc. A cloud-based networkenvironment may include a framework layer, a job scheduler, a resourcemanager, and a distributed file system implemented on one or more ofservers, which may include one or more core network servers and/or edgeservers. A framework layer may include a framework to support softwareof a software layer and/or one or more application(s) of an applicationlayer. The software or application(s) may respectively include web-basedservice software or applications. In embodiments, one or more of theclient devices may use the web-based service software or applications(e.g., by accessing the service software and/or applications via one ormore application programming interfaces (APIs)). The framework layer maybe, but is not limited to, a type of free and open-source software webapplication framework such as that may use a distributed file system forlarge-scale data processing (e.g., “big data”).

A cloud-based network environment may provide cloud computing and/orcloud storage that carries out any combination of computing and/or datastorage functions described herein (or one or more portions thereof).Any of these various functions may be distributed over multiplelocations from central or core servers (e.g., of one or more datacenters that may be distributed across a state, a region, a country, theglobe, etc.). If a connection to a user (e.g., a client device) isrelatively close to an edge server(s), a core server(s) may designate atleast a portion of the functionality to the edge server(s). Acloud-based network environment may be private (e.g., limited to asingle organization), may be public (e.g., available to manyorganizations), and/or a combination thereof (e.g., a hybrid cloudenvironment).

The client device(s) may include at least some of the components,features, and functionality of the example processing system 500 of FIG.5B and/or exemplary system 565 of FIG. 5C. By way of example and notlimitation, a client device may be embodied as a Personal Computer (PC),a laptop computer, a mobile device, a smartphone, a tablet computer, asmart watch, a wearable computer, a Personal Digital Assistant (PDA), anMP3 player, a virtual reality headset, a Global Positioning System (GPS)or device, a video player, a video camera, a surveillance device orsystem, a vehicle, a boat, a flying vessel, a virtual machine, a drone,a robot, a handheld communications device, a hospital device, a gamingdevice or system, an entertainment system, a vehicle computer system, anembedded system controller, a remote control, an appliance, a consumerelectronic device, a workstation, an edge device, any combination ofthese delineated devices, or any other suitable device.

Machine Learning

Deep neural networks (DNNs) developed on processors, such as the PPU 300have been used for diverse use cases, from self-driving cars to fasterdrug development, from automatic image captioning in online imagedatabases to smart real-time language translation in video chatapplications. Deep learning is a technique that models the neurallearning process of the human brain, continually learning, continuallygetting smarter, and delivering more accurate results more quickly overtime. A child is initially taught by an adult to correctly identify andclassify various shapes, eventually being able to identify shapeswithout any coaching. Similarly, a deep learning or neural learningsystem needs to be trained in object recognition and classification forit to get smarter and more efficient at identifying basic objects,occluded objects, etc., while also assigning context to objects.

At the simplest level, neurons in the human brain look at various inputsthat are received, importance levels are assigned to each of theseinputs, and output is passed on to other neurons to act upon. Anartificial neuron or perceptron is the most basic model of a neuralnetwork. In one example, a perceptron may receive one or more inputsthat represent various features of an object that the perceptron isbeing trained to recognize and classify, and each of these features isassigned a certain weight based on the importance of that feature indefining the shape of an object.

A deep neural network (DNN) model includes multiple layers of manyconnected nodes (e.g., perceptrons, Boltzmann machines, radial basisfunctions, convolutional layers, etc.) that can be trained with enormousamounts of input data to quickly solve complex problems with highaccuracy. In one example, a first layer of the DNN model breaks down aninput image of an automobile into various sections and looks for basicpatterns such as lines and angles. The second layer assembles the linesto look for higher level patterns such as wheels, windshields, andmirrors. The next layer identifies the type of vehicle, and the finalfew layers generate a label for the input image, identifying the modelof a specific automobile brand.

Once the DNN is trained, the DNN can be deployed and used to identifyand classify objects or patterns in a process known as inference.Examples of inference (the process through which a DNN extracts usefulinformation from a given input) include identifying handwritten numberson checks deposited into ATM machines, identifying images of friends inphotos, delivering movie recommendations to over fifty million users,identifying and classifying different types of automobiles, pedestrians,and road hazards in driverless cars, or translating human speech inreal-time.

During training, data flows through the DNN in a forward propagationphase until a prediction is produced that indicates a labelcorresponding to the input. If the neural network does not correctlylabel the input, then errors between the correct label and the predictedlabel are analyzed, and the weights are adjusted for each feature duringa backward propagation phase until the DNN correctly labels the inputand other inputs in a training dataset. Training complex neural networksrequires massive amounts of parallel computing performance, includingfloating-point multiplications and additions that are supported by thePPU 300. Inferencing is less compute-intensive than training, being alatency-sensitive process where a trained neural network is applied tonew inputs it has not seen before to classify images, translate speech,and generally infer new information.

Neural networks rely heavily on matrix math operations, and complexmulti-layered networks require tremendous amounts of floating-pointperformance and bandwidth for both efficiency and speed. With thousandsof processing cores, optimized for matrix math operations, anddelivering tens to hundreds of TFLOPS of performance, the PPU 300 is acomputing platform capable of delivering performance required for deepneural network-based artificial intelligence and machine learningapplications.

Furthermore, images generated applying one or more of the techniquesdisclosed herein may be used to train, test, or certify DNNs used torecognize objects and environments in the real world. Such images mayinclude scenes of roadways, factories, buildings, urban settings, ruralsettings, humans, animals, and any other physical object or real-worldsetting. Such images may be used to train, test, or certify DNNs thatare employed in machines or robots to manipulate, handle, or modifyphysical objects in the real world. Furthermore, such images may be usedto train, test, or certify DNNs that are employed in autonomous vehiclesto navigate and move the vehicles through the real world. Additionally,images generated applying one or more of the techniques disclosed hereinmay be used to convey information to users of such machines, robots, andvehicles.

FIG. 5D illustrates components of an exemplary system 555 that can beused to train and utilize machine learning, in accordance with at leastone embodiment. As will be discussed, various components can be providedby various combinations of computing devices and resources, or a singlecomputing system, which may be under control of a single entity ormultiple entities. Further, aspects may be triggered, initiated, orrequested by different entities. In at least one embodiment training ofa neural network might be instructed by a provider associated withprovider environment 506, while in at least one embodiment trainingmight be requested by a customer or other user having access to aprovider environment through a client device 502 or other such resource.In at least one embodiment, training data (or data to be analyzed by atrained neural network) can be provided by a provider, a user, or athird party content provider 524. In at least one embodiment, clientdevice 502 may be a vehicle or object that is to be navigated on behalfof a user, for example, which can submit requests and/or receiveinstructions that assist in navigation of a device.

In at least one embodiment, requests are able to be submitted across atleast one network 504 to be received by a provider environment 506. Inat least one embodiment, a client device 502 may be any appropriateelectronic and/or computing devices enabling a user to generate and sendsuch requests, such as, but not limited to, desktop computers, notebookcomputers, computer servers, smartphones, tablet computers, gamingconsoles (portable or otherwise), computer processors, computing logic,and set-top boxes. Network(s) 504 can include any appropriate networkfor transmitting a request or other such data, as may include theInternet, an intranet, a cellular network, a local area network (LAN), awide area network (WAN), a personal area network (PAN), an ad hocnetwork of direct wireless connections among peers, and so on.

In at least one embodiment, requests can be received at an interfacelayer 508, which can forward data to a training and inference manager532, in this example. The training and inference manager 532 can be asystem or service including hardware and software for managing requestsand service corresponding data or content, in at least one embodiment,the training and inference manager 532 can receive a request to train aneural network, and can provide data for a request to a training module512. In at least one embodiment, training module 512 can select anappropriate model or neural network to be used, if not specified by therequest, and can train a model using relevant training data. In at leastone embodiment, training data can be a batch of data stored in atraining data repository 514, received from client device 502, orobtained from a third party provider 524. In at least one embodiment,training module 512 can be responsible for training data. A neuralnetwork can be any appropriate network, such as a recurrent neuralnetwork (RNN) or convolutional neural network (CNN). Once a neuralnetwork is trained and successfully evaluated, a trained neural networkcan be stored in a model repository 516, for example, that may storedifferent models or networks for users, applications, or services, etc.In at least one embodiment, there may be multiple models for a singleapplication or entity, as may be utilized based on a number of differentfactors.

In at least one embodiment, at a subsequent point in time, a request maybe received from client device 502 (or another such device) for content(e.g., path determinations) or data that is at least partiallydetermined or impacted by a trained neural network. This request caninclude, for example, input data to be processed using a neural networkto obtain one or more inferences or other output values,classifications, or predictions, or, for at least one embodiment, inputdata can be received by interface layer 508 and directed to inferencemodule 518, although a different system or service can be used as well.In at least one embodiment, inference module 518 can obtain anappropriate trained network, such as a trained deep neural network (DNN)as discussed herein, from model repository 516 if not already storedlocally to inference module 518. Inference module 518 can provide dataas input to a trained network, which can then generate one or moreinferences as output. This may include, for example, a classification ofan instance of input data. In at least one embodiment, inferences canthen be transmitted to client device 502 for display or othercommunication to a user. In at least one embodiment, context data for auser may also be stored to a user context data repository 522, which mayinclude data about a user which may be useful as input to a network ingenerating inferences, or determining data to return to a user afterobtaining instances. In at least one embodiment, relevant data, whichmay include at least some of input or inference data, may also be storedto a local database 534 for processing future requests. In at least oneembodiment, a user can use account information or other information toaccess resources or functionality of a provider environment. In at leastone embodiment, if permitted and available, user data may also becollected and used to further train models, in order to provide moreaccurate inferences for future requests. In at least one embodiment,requests may be received through a user interface to a machine learningapplication 526 executing on client device 502, and results displayedthrough a same interface. A client device can include resources such asa processor 528 and memory 562 for generating a request and processingresults or a response, as well as at least one data storage element 552for storing data for machine learning application 526.

In at least one embodiment a processor 528 (or a processor of trainingmodule 512 or inference module 518) will be a central processing unit(CPU). As mentioned, however, resources in such environments can utilizeGPUs to process data for at least certain types of requests. Withthousands of cores, GPUs, such as PPU 300 are designed to handlesubstantial parallel workloads and, therefore, have become popular indeep learning for training neural networks and generating predictions.While use of GPUs for offline builds has enabled faster training oflarger and more complex models, generating predictions offline impliesthat either request-time input features cannot be used or predictionsmust be generated for all permutations of features and stored in alookup table to serve real-time requests. If a deep learning frameworksupports a CPU-mode and a model is small and simple enough to perform afeed-forward on a CPU with a reasonable latency, then a service on a CPUinstance could host a model. In this case, training can be done offlineon a GPU and inference done in real-time on a CPU. If a CPU approach isnot viable, then a service can run on a GPU instance. Because GPUs havedifferent performance and cost characteristics than CPUs, however,running a service that offloads a runtime algorithm to a GPU can requireit to be designed differently from a CPU based service.

In at least one embodiment, video data can be provided from clientdevice 502 for enhancement in provider environment 506. In at least oneembodiment, video data can be processed for enhancement on client device502. In at least one embodiment, video data may be streamed from a thirdparty content provider 524 and enhanced by third party content provider524, provider environment 506, or client device 502. In at least oneembodiment, video data can be provided from client device 502 for use astraining data in provider environment 506.

In at least one embodiment, supervised and/or unsupervised training canbe performed by the client device 502 and/or the provider environment506. In at least one embodiment, a set of training data 514 (e.g.,classified or labeled data) is provided as input to function as trainingdata. In an embodiment, the set of training data may be used in agenerative adversarial training configuration to train a generatorneural network.

In at least one embodiment, training data can include images of at leastone human subject, avatar, character, animal, object, or the like, forwhich a neural network is to be trained. In at least one embodiment,training data can include instances of at least one type of object forwhich a neural network is to be trained, as well as information thatidentifies that type of object. In at least one embodiment, trainingdata might include a set of images that each includes a representationof a type of object, where each image also includes, or is associatedwith, a label, metadata, classification, or other piece of informationidentifying a type of object represented in a respective image. Variousother types of data may be used as training data as well, as may includetext data, audio data, video data, and so on. In at least oneembodiment, training data 514 is provided as training input to atraining module 512. In at least one embodiment, training module 512 canbe a system or service that includes hardware and software, such as oneor more computing devices executing a training application, for traininga neural network (or other model or algorithm, etc.). In at least oneembodiment, training module 512 receives an instruction or requestindicating a type of model to be used for training, in at least oneembodiment, a model can be any appropriate statistical model, network,or algorithm useful for such purposes, as may include an artificialneural network, deep learning algorithm, learning classifier, Bayesiannetwork, and so on. In at least one embodiment, training module 512 canselect an initial model, or other untrained model, from an appropriaterepository 516 and utilize training data 514 to train a model, therebygenerating a trained model (e.g., trained deep neural network) that canbe used to classify similar types of data, or generate other suchinferences. In at least one embodiment where training data is not used,an appropriate initial model can still be selected for training on inputdata per training module 512.

In at least one embodiment, a model can be trained in a number ofdifferent ways, as may depend in part upon a type of model selected. Inat least one embodiment, a machine learning algorithm can be providedwith a set of training data, where a model is a model artifact createdby a training process. In at least one embodiment, each instance oftraining data contains a correct answer (e.g., classification), whichcan be referred to as a target or target attribute. In at least oneembodiment, a learning algorithm finds patterns in training data thatmap input data attributes to a target, an answer to be predicted, and amachine learning model is output that captures these patterns. In atleast one embodiment, a machine learning model can then be used toobtain predictions on new data for which a target is not specified.

In at least one embodiment, training and inference manager 532 canselect from a set of machine learning models including binaryclassification, multiclass classification, generative, and regressionmodels. In at least one embodiment, a type of model to be used candepend at least in part upon a type of target to be predicted.

Images generated applying one or more of the techniques disclosed hereinmay be displayed on a monitor or other display device. In someembodiments, the display device may be coupled directly to the system orprocessor generating or rendering the images. In other embodiments, thedisplay device may be coupled indirectly to the system or processor suchas via a network. Examples of such networks include the Internet, mobiletelecommunications networks, a WIFI network, as well as any other wiredand/or wireless networking system. When the display device is indirectlycoupled, the images generated by the system or processor may be streamedover the network to the display device. Such streaming allows, forexample, video games or other applications, which render images, to beexecuted on a server, a data center, or in a cloud-based computingenvironment and the rendered images to be transmitted and displayed onone or more user devices (such as a computer, video game console,smartphone, other mobile device, etc.) that are physically separate fromthe server or data center. Hence, the techniques disclosed herein can beapplied to enhance the images that are streamed and to enhance servicesthat stream images such as NVIDIA GeForce Now (GFN), Google Stadia, andthe like.

Weight Demodulation for a Generator Neural Network

The style-based GAN architecture (StyleGAN) implemented in thestyle-based generator system 100 yields impressive results indata-driven unconditional generative image modeling. However, thestyle-based GAN architecture may synthesize images that includeundesirable artifacts. As described further herein, several of thecharacteristic artifacts may be avoided or reduced by changing thesynthesis neural network structure and/or training methods. In anembodiment, the normalization operation is restructured, and thestyle-based generator system may be regularized to encourage goodconditioning in the mapping from latent vectors to output data, such asimages. Improving the style-based GAN architecture to avoid and/orreduce artifacts improves the results considerably in unconditionalimage modeling, both in terms of existing distribution quality metricsas well as perceived output data quality.

More illustrative information will now be set forth regarding variousoptional architectures and features with which the foregoing frameworkmay be implemented, per the desires of the user. It should be stronglynoted that the following information is set forth for illustrativepurposes and should not be construed as limiting in any manner. Any ofthe following features may be optionally incorporated with or withoutthe exclusion of other features described.

FIG. 6A illustrates artifacts in images and feature maps that may begenerated by the style-based generator system 100, in accordance with anembodiment. An artifact 601 appears as a blob-shaped anomaly resemblinga water droplet. Even when the artifact 601 may not be obvious in thefinal image, artifact 602 is present in the intermediate feature mapsproduced by the synthesis neural network. In an embodiment, the anomalystarts to appear around 64×64 resolution, is present in all subsequentfeature maps, and becomes progressively stronger at higher resolutions.In another example, an artifact 603 is visible in a final image of avehicle and a corresponding artifact 604 is present in a feature mapthat is generated during synthesis of the final output image of thevehicle. In another example, an artifact 605 is visible in a finaloutput image of a horse and a corresponding artifact 606 is present in afeature map that is generated during synthesis of the final output imageof the horse. The existence of such a consistent artifact is puzzling,as a discriminator should be able to detect it during training.

The “blob” or “water droplet” artifacts in images generated by thesynthesis neural network 140 seem to be caused because the normalizationoperation performed in the processing layers of the synthesis neuralnetwork 140 is too destructive and completely removes the mean and scaleof the intermediate activations for each feature map. In effect, thestyle-based GAN likely creates the artifacts to circumvent a design flawin its architecture.

In review, a distinguishing feature of the style-based generator system100 is the unconventional architecture of the generator. Instead offeeding the latent code z∈

directly as an input to the synthesis neural network 140, the mappingneural network 110 first transforms the input latent code to anintermediate latent code w∈

. Affine transforms performed by the style conversion unit 115 thenproduce the style signals that control the layers of the synthesisneural network 140 via adaptive instance normalization (AdaIN). In thecontext of the following description, instance normalization refers toperforming normalization separately or independently for each instanceor sample (image), without interaction between samples. In contrast,when batch normalization is used all samples in a minibatch arenormalized together. Additionally, in an embodiment, stochasticvariation is facilitated by providing additional random noise maps tothe synthesis neural network 140. The noise maps may be inserted intointermediate data output by each convolution layer of the synthesisneural network 140. It has been demonstrated that the unconventionaldesign allows the intermediate latent space

to be much less entangled than the input latent space

. In the context of the following description, the analysis is focusedsolely on

, as it is the relevant latent space from the point of view of thesynthesis neural network 140.

The artifacts are introduced by the AdaIN operation that normalizes themean and variance of each feature map separately, thereby potentiallydestroying any information found in the magnitudes of the featuresrelative to each other. The droplet artifact may be a result of thestyle-based generator system 100 intentionally sneaking signal strengthinformation past instance normalization. More specifically, by creatinga strong, localized spike that dominates the statistics, the style-basedgenerator system 100 can effectively scale the signal as it likeselsewhere. This hypothesis is supported by the finding that, in anembodiment, when the normalization step is removed from the synthesisneural network 140, as detailed below, the droplet artifacts disappearcompletely.

FIG. 6B illustrates a block diagram of the processing block 200 shown inFIG. 2B, in accordance with an embodiment. In the synthesis neuralnetwork 140 shown in FIGS. 1A and 2B, style signals may be active foreach processing stage to apply attributes that are specific to theprocessing stage. In an embodiment, the style conversion unit 115applies a learned affine transformation to

to produce each style signal. Conceptually, feature maps (representingcontent of an image) generated by different processing layers 125, 135,and/or 220 of the synthesis neural network 140 are modified based onstyle signals provided by the mapping neural network 110. In otherwords, the first order statistics are replaced with style-specificattributes for each stage. Compared with FIGS. 1A and 2B, the adaptiveinstance normalization (AdaIN) operation within the layers 120 and 130and the modules 220 is broken down into to its two constituent parts:normalization 620 followed by modulation 625, both operating on the meanand standard deviation per feature map. The normalization 620 isperformed for each style application to avoid accumulation of theparticular style in subsequent stages where different styles may beapplied at different scales.

Before the normalization 620, spatial noise may be inserted into thefirst intermediate data by element 610. In an embodiment, the firstintermediate data is the learned constant or input sample. In anembodiment (not shown), a bias may also be applied for each scale alongwith the spatial noise. Learned parameters (weights) are applied by eachconvolution layer 225. A style block 600 that includes at least theconvolution layer 225, normalization 620, insertion of spatial noise byelement 610, and demodulation 625 may be restructured to removeartifacts by demodulating the weights (instead of normalizing theactivations). Interestingly, the synthesis neural network 140 appliesthe spatial noise within the processing block 200, causing a relativeimpact of the spatial noise to be inversely proportional to a magnitudeof the style signal that is applied at the processing block 200. Morepredictable results may be obtained by moving the insertion operationoutside of the processing block 200, so that the insertion insteadoperates on normalized data.

FIG. 6C illustrates a block diagram of a style block 640, for use inimplementing some embodiments of the present disclosure. Compared withthe processing block 200 shown in FIG. 6B, insertion of the spatialnoise (and bias) by the element 610 is moved outside of the style block640. In other words, the spatial noise and bias are applied independentof each style encoded in a style signal. In an embodiment, after movingthe insertion operation outside of the style block 600 to produce thestyle block 640, it is sufficient for the normalization and modulationto operate on the standard deviation alone (i.e., the mean is notneeded). In an embodiment, the application of bias, spatial noise, andnormalization to the input sample (e.g., first intermediate data) canalso be safely removed without observable drawbacks.

Compared with the normalization 620 and modulation 625 in the styleblock 600, modulation of the mean is removed and the modulation unit 630and normalization unit 635 only operate on the standard deviation. Themodulation unit 630 modulates the first intermediate data based on thestyle signal to produce modulated features. In an embodiment, inaddition to the modulation unit 630, the convolution layer 225, and thenormalization unit 635, the style block 640 may also include anupsampler 632 that performs operations similar to the upsampler 235 ofFIG. 2B. The modulated features are upsampled (or not) and input to theconvolution layer 225 as input activations. The parameters are appliedto the input activations by the convolution layer 225 to produce outputactivations.

The style block 640 may be restructured to relax or reduce the strengthof the normalization operation while retaining the scale-specificeffects of the styles. Simply removing the instance normalizationoperation improves the image quality (e.g., the blob artifacts areremoved). However, removing the instance normalization also causes theeffects of the styles to be cumulative rather than specific to eachscale. Therefore, the controllability provided by scale-specific stylesfor synthesis is greatly reduced. An alternative that removes theartifacts while retaining controllability is to base normalization onthe expected statistics of the incoming feature maps, but withoutexplicit forcing.

Recall that the style block 640 in FIG. 6C includes at least themodulation unit 630, the convolution layer 225, and the normalizationunit 635. The effect of a modulation followed by a convolution is thatthe modulation scales each input feature map of the convolution based onthe incoming style, which can alternatively be implemented by scalingthe convolution weights:w′ _(ijk) =s _(i) ·w _(ijk),  Eq. (2)where w and w′ are the original and modulated weights, respectively,s_(i) is the scale factor corresponding to the ith input feature map,and j and k enumerate the output feature maps and spatial footprint ofthe convolution, respectively.

Now, the purpose of instance normalization is to essentially remove theeffect of s from the statistics of the output feature maps produced byeach convolution. The goal of removing the effect of s from the outputfeature maps can be achieved more directly. Assuming that intermediatedata, that are input to the style block 640 are independent andidentically distributed (i.i.d.) random variables with unit standarddeviation, then after modulation and convolution, the output activationsproduced by the convolution layer 225 have standard deviation ofσ_(j)=√{square root over (Σ_(i,k) w′ _(ijk) ²)},  Eq. (3)i.e., each output feature map is scaled by the L² norm of thecorresponding weights. The subsequent normalization aims to restore theoutput activations back to unit standard deviation. Based on Equation(3), restoring the outputs is achieved if each output feature map j isscaled (“demodulated”) by 1/σ_(j). Alternatively, the demodulation canbe combined into the convolution weights:w″ _(ijk) =w′ _(ijk)/√{square root over (Σ_(i,k) w′ _(ijk) ²+ϵ)}  Eq.(4)where ϵ is a small constant to avoid numerical issues.

Considering the practical implementation of Equations (2) and (4), it isimportant to note that the resulting set of weights will be differentfor each sample in a minibatch, which may rule out direct implementationusing standard convolution primitives. In an embodiment, groupedconvolutions may be employed to temporarily reshape the weights andactivations so that each convolution sees one sample with Ngroups—instead of N samples with one group. The grouped convolutions areefficient because the reshaping operations do not actually modify thecontent of the weight and activation tensors. In another embodiment,explicit scaling operations may be employed before and after theconvolution.

FIG. 6D illustrates a block diagram of a style block 645, for use inimplementing some embodiments of the present disclosure. Thenormalization unit 635 in the style block 640 is replaced with a“demodulation” operation that is applied to the weights associated witheach convolution layer 225 in the style bock 645. It should beunderstood that this and other arrangements described herein are setforth only as examples. Other arrangements and elements (e.g., machines,interfaces, functions, orders, groupings of functions, etc.) may be usedin addition to or instead of those shown, and some elements may beomitted altogether. Further, many of the elements described herein arefunctional entities that may be implemented as discrete or distributedcomponents or in conjunction with other components, and in any suitablecombination and location. Various functions described herein as beingperformed by entities may be carried out by hardware, firmware, and/orsoftware. For instance, various functions may be carried out by aprocessor executing instructions stored in memory. Furthermore, personsof ordinary skill in the art will understand that any system thatperforms the operations of the style block 640 or 645 is within thescope and spirit of embodiments of the present disclosure.

As shown in FIG. 6D, instead of normalizing the features (e.g.,intermediate data), the weights are normalized based on the “expectedstatistics” of the intermediate data. Because convolution is a linearoperator, scaling the weights is equivalent to scaling the features.Therefore, compared with the style block 640, the modulation unit 630and normalization unit 635 are removed from processing the features anda modulation unit 650 and demodulation unit 655 are inserted in theprocessing path for the weights.

The weights are first modulated by the style signal by the modulationunit 650 to produce modulated weights. Modulating the weights isequivalent to the modulation unit 630 scaling the first intermediatedata to produce the modulated features in the style block 640. In thestyle block 645, input features are optionally upsampled by theupsampler 632 and input to the convolution layer 225 to produce outputfeatures. An expected standard deviation of the output features iscomputed, assuming that the input features are normally distributed.Finally, the modulated weights are demodulated by the demodulation unit655, based on the expected standard deviation, to produce normalizedweights. Demodulating the modified weights is equivalent to scaling theoutput features generated by the convolution layer 225. Spatial noise isoptionally inserted into the output features to produce modifiedfeatures. A synthesis neural network that includes at least one styleblock 645 may then generate output data (e.g., images) according to thestyles, but without the “blob” artifacts or with significantly reducedartifacts.

The weights for each convolution layer 225 are adjusted within the styleblock 645 based on s using Equations (2) and (4). To avoid having toaccount for the activation function in Equation (4), the activationfunctions may be scaled so that they retain the expected signalvariance. Compared to instance normalization, the demodulation techniqueis weaker because it is based on statistical assumptions about thesignal instead of actual contents of the feature maps. In sum,statistical analysis is implemented by the style block 645 as areplacement for data-dependent normalization.

FIG. 6E illustrates a flowchart of a method 660 for demodulating weightsapplied by a generator neural network, in accordance with an embodiment.Each block of method 660, described herein, comprises a computingprocess that may be performed using any combination of hardware,firmware, and/or software. For instance, various functions may becarried out by a processor executing instructions stored in memory. Themethod may also be embodied as computer-usable instructions stored oncomputer storage media. The method may be provided by a standaloneapplication, a service or hosted service (standalone or in combinationwith another hosted service), or a plug-in to another product, to name afew. In addition, method 660 is described, by way of example, withrespect to the style block 645 of FIG. 6D. However, this method mayadditionally or alternatively be executed by any one system, or anycombination of systems, including, but not limited to, those describedherein. Furthermore, persons of ordinary skill in the art willunderstand that any system that performs method 660 is within the scopeand spirit of embodiments of the present disclosure.

At step 665, the style block 645 receives first weights for modifyingfirst features at a first stage of a generator neural network includingmultiple stages, wherein a last stage of the generator neural networkproduces output data. In an embodiment, the synthesis neural network 140of the style-based generator system 100 is restructured to implement thestyle block 645 to produce the output data. In an embodiment, componentsof the first intermediate data input to the synthesis neural network 140are adjusted during training and initialized using N (0,1). In anotherembodiment, the first intermediate data corresponds to (or is derivedfrom) additional input data, such as a reference image.

At step 670, modulation unit 650 modulates the first weights with afirst style control signal to produce first modulated weights. At step675, the demodulation unit 655 demodulates the first modulated weightsto produce first normalized weights. In an embodiment, the modulationunit 650 and demodulation unit 655 perform demodulation to change theweights (instead of activations) on a per-sample basis. In other words,the weights may be modulated for each first intermediate data that isinput to the synthesis neural network 140. At step 680, the firstnormalized weights are applied by the first stage, to produce modifiedfirst features. In an embodiment, the modified first features are theoutput features generated by the style block 645. In an embodiment, themodified first features are modified features resulting from theinsertion of spatial noise into the output features. At step 685, themodified first features are processed by at least one additional stageof the generator neural network to produce the output data that includescontent corresponding to the first features.

In an embodiment, the at least one additional stage comprises anotherstyle block 645. In an embodiment, spatial noise and/or a bias isinserted to further modify the modified features, producing modifiedintermediate data that is processed by the at least one additional stageof the generator neural network. In an embodiment, the weight modulationand demodulation operations are included in a synthesis neural networkcomprising one or more stages that each include a style block 645 andthe demodulation operation is omitted from the output style block 645.

FIG. 6F illustrates output images 662 and modified feature maps 664 and668 that are generated using weight demodulation, in accordance with anembodiment. Compared with the output images in FIG. 6A, visibleartifacts are either missing or are greatly reduced in the output images662. Similarly, visible artifacts are either missing or are greatlyreduced in the modified feature maps 664 and 668 that are produced bystyle blocks 645 for different scales. The reduction and/or removal ofartifacts is achieved while retaining full controllability of styles atdifferent scales. Furthermore, training time may be reduced as a resultof a simplified dataflow for modulating and demodulating the weightsinstead of the feature maps.

Smoothing Regularization for a Generator Neural Network

A smoothness regularization technique may also be used, in combinationwith or independent of the weight demodulation, to improve quality ofoutput data produced by a generator neural network. Smoothnessregularization strives to ensure that small changes in the input to aneural network cause small changes in the output in such a way that themagnitude of the change remains uniform across the space of possibleinputs, as well as possible directions of changing the inputs. In otherwords, small changes in the latent space (or the intermediate latentspace that, in turn, change the style signals) should result in smallchanges in the output space (e.g., images). Achieving a uniformdistribution of the changes in the input space and a uniformdistribution of corresponding changes in the output space is the goal.The smoothness regularization technique may be used to encourage asmooth transformation between a latent space to the output data, betweenthe first intermediate data and either other intermediate data or theoutput, between any two intermediate data, or between any intermediatedata and the output.

A metric that may be used to measure smoothness may also indicateimproved quality in the output data. During training, the metric may beused to adjust the learned parameters of the style-based generatorsystem 100. In particular, weights for the synthesis neural network 140may be adjusted by smoothness regularization to improve the metric aswell as the quality of output data.

Several metrics are available for quantitative analysis of the qualityof images produced using generative methods. Frechet inception distance(FID) measures differences in the density of two distributions in thehigh dimensional feature space of a Inception V3 classifier. Precisionand Recall (P&R) provide additional visibility by explicitly quantifyingthe percentage of generated images that are similar to training data andthe percentage of training data that can be generated, respectively.While FID and P&R successfully capture many aspects of a generator, bothmetrics have somewhat of a blind spot for image quality. FID and P&R arebased on classifier networks that have recently been shown to focus ontextures rather than shapes, and consequently, these metrics do notaccurately capture all aspects of image quality. However, a perceptualpath length (PPL) metric, originally introduced as a method forestimating the quality of latent space interpolations, correlates withconsistency and stability of shapes. PPL quantifies smoothness of atransformation by estimating the expected path length of a randominterpolation path in the intermediate latent space, measured in termsof perceptual changes to the image over the course of interpolation. ThePPL metric can be computed for individual images (Per-image PPL) byconsidering infinitesimally short interpolation paths in the immediatevicinity of a given image. In an embodiment, the synthesis neuralnetwork 140 may be trained based on the PPL metric to favor smoothtransformations and achieve an improvement in the quality of the outputdata that is generated.

FIG. 7A illustrates images generated by the style-based generator system100 that have high PPL scores (long interpolation paths), in accordancewith an embodiment. The six images each include a cat, but in each imagea shape of the cat is distorted and/or discontinuous, sometimesscrambled with other scene elements. In other words, the six images inFIG. 7A lack semantic consistency. The PPL score computed for each ofthe images in FIG. 7A is in the top 90^(th) percentile of a set ofrandom example images generated by the style-based generator system 100.

FIG. 7B illustrates images generated using by the style-based generatorsystem 100 that have low PPL scores (short interpolation paths), inaccordance with an embodiment. The six images in FIG. 7B also eachinclude a cat and each cat appears mostly as expected. None of the catsappear discontinuous or scrambled with other elements of the scene. Inother words, the six images in FIG. 7B are generally semanticallyconsistent. The PPL score computed for each of the images in FIG. 7B isin the bottom 10^(th) percentile of a set of random example imagesgenerated by the style-based generator system 100.

As can be observed by comparing the quality of the images in FIGS. 7Aand 7B, there is a correlation between perceived image quality and thecomputed PPL metric. The PPL metric is computed by measuring averagelearned perceptual image patch similarity (LPIPS) distances betweengenerated images under small perturbations in latent space. A lower PPL(smoother generator mapping) appears to correlate with higher overallimage quality, whereas other metrics lack a correlation with imagequality.

In practice, applying smoothness regularization between an intermediatelatent code and the output image is highly beneficial considering thequality of the generated images. The benefit of smoothnessregularization can be understood by comparing the distribution ofper-image PPL scores for the style-based generator system 100 trainedwith and without smoothness regularization.

FIG. 7C illustrates a graph of the PPL scores 700 for a set of images,in accordance with an embodiment. The images are generated by changingthe input latent code or the intermediate latent code by a small amountto produce each new image. In other words, a small movement in theintermediate latent space should correspond to a small change in theoutput data. The set of images may include the images shown in FIGS. 7Aand 7B. PPL scores in a region 705 of the distribution are low PPLscores corresponding to high-quality images, including the images shownin FIG. 7B. PPL scores in a region 710 of the distribution are high PPLscores corresponding to low-quality images, including the images shownin FIG. 7A. An image in the region 710 exhibits a large and/ordiscontinuous change relative to the change in the input latent codethat produced the image. In other words, in response to a small changein the latent code, the image changes abruptly rather than smoothlycompared with the previous image. The images are generated by thestyle-based generator system 100 using different random seed values asinput and path lengths are computed based on path endpoints in W.

FIG. 7D illustrates a distribution of PPL scores 720 for a set of imagesgenerated when smoothing regularization is used, in accordance with anembodiment. In an embodiment, the smoothing regularization technique isapplied to the style-based generator system 100 during training. Themapping neural network 110 receives an input latent code and produces anintermediate latent code. The synthesis neural network 140, in turn,receives the intermediate latent code and produces an output image.Specifically, smoothing regularization is applied between theintermediate latent code and the output image to ensure that thetransformation between the intermediate latent code and the output imageis smooth. In an embodiment, smoothing regularization is applied betweenone of the style signals and the output data. The average FID computedfor the images associated with the distribution of PPL scores 700 and720 are equal. However, the average PPL scores are quite different andthe tail of the distribution within region 710 of the distribution ofPPL scores 700 is missing in the distribution of PPL scores 720.

It is not immediately obvious why a low PPL should correlate with imagequality. Perhaps, during training, as the discriminator 275 penalizesbroken images, the most direct way for the style-based generator system100 to improve is to effectively stretch the region of latent space thatyields good images. As a result, the low-quality images may be squeezedinto small latent space regions of rapid change. While the stretchingand squeezing of different latent space regions may improve the averageoutput quality in the short term, the accumulating distortions impairthe training dynamics and consequently the final image quality. Theempirical correlation between lower PPL and increased output qualitysuggests that favoring a smooth generator mapping by encouraging low PPLduring training may improve image quality.

Excess path distortion in the style-based generator system 100 isevident as poor local conditioning: any small region in the intermediatelatent space

becomes arbitrarily squeezed and stretched as the style-based generatorsystem 100 is trained. A generator mapping from the latent space toimage space is considered to be well-conditioned if, at each point inlatent space, small displacements yield changes of equal magnitude inimage space, regardless of the direction of perturbation. The smalldisplacements may be applied in the latent space to producecorresponding changes of equal magnitude in the image space or the smalldisplacements may be applied in the image space to produce correspondingchanges of equal magnitude in the latent space.

The synthesis neural network 140 shown in FIG. 2B includes a sequence ofprocessing blocks 200 and 230 that each generate intermediate data(activations). Regularization may be applied to the synthesis neuralnetwork 140 to ensure the transformation between the intermediate latentcode and the output image is smooth. Alternatively, regularization maybe applied between any two corresponding points in the synthesis neuralnetwork 140. For example, the relationship between outputs (e.g., outputfeatures or modified features) from any pair of the style blocks 645 canbe regularized. The final style block 645 generates the output image.Alternatively, regularization can be applied to other generator neuralnetwork architectures. In an embodiment, to balance the computationalexpense of regularization, regularization may be performed lessfrequently without necessarily compromising effectiveness.

FIG. 7E illustrates a conceptual diagram of paths withoutregularization, in accordance with an embodiment. A linear trajectory ofa style signal 725 is produced by changing the style signal repeatedlyby the same magnitude. In response, the synthesis neural network 140produces a curved trajectory of the output data 730. The curvedtrajectory results from changes in the output data that have varyingmagnitude compared with the changes of equal magnitude in the stylesignal.

FIG. 7F illustrates a conceptual diagram of paths with regularization,in accordance with an embodiment. The mapping network 110 is trained tomap a latent code into an intermediate latent space and generate a stylesignal. The mapping shown in FIG. 7F is more uniform compared with themapping shown in FIG. 7E. A linear trajectory of a style signal 735 isproduced by changing the style signal repeatedly by the same magnitude.In response, the synthesis neural network 140 produces a nearly lineartrajectory of the output data 740 having changes of the same magnitude.A change in the style signal of a first magnitude produces acorresponding change in the output data of a similar magnitude.

FIG. 8A illustrates a block diagram of a synthesis neural network 840implemented using the style block 645 of FIG. 6D, for use inimplementing some embodiments of the present disclosure. The synthesisneural network 840 includes a sequence of style blocks 645 and a styleblock 646. Compared with the style blocks 645, the demodulation unit 640is omitted from the style block 646 because it is the last style blockin the synthesis neural network 840. The first style block 645 receivesthe first intermediate data, first style signal, and at least a portionof the weights in a set of weights. The weights are processed accordingto the first style signal and applied to the first intermediate data toproduce second intermediate data. The second intermediate data includescontent encoded in the first intermediate data that is modified based onthe first style signal. Spatial noise and/or a bias (not shown) may beinserted into the second intermediate data.

The second style block 645, receives the second intermediate data,second style signal, and at least another portion of the weights in theset of weights. The weights are processed according to the second stylesignal and applied to the second intermediate data to produce thirdintermediate data. The third intermediate data includes content encodedin the first intermediate data that is modified based on the first stylesignal and the second style signal. In an embodiment, the first andsecond style signals operate at different scales. Thus, the stylemodifications resulting from the first style signal are retained in thethird intermediate data. In other embodiments, one or more additionalstyle blocks 645 may be included between the second style block 645 andthe style block 646. In another embodiment, the second style block 645is omitted and the style block 646 receives the second intermediatedata. Spatial noise and/or a bias (not shown) may be inserted into thethird intermediate data.

The style block 646, receives the third intermediate data, third stylesignal, and at least another portion of the weights in the set ofweights. The weights are processed according to the third style signaland applied to the third intermediate data to produce fourthintermediate data. The fourth intermediate data includes content encodedin the first intermediate data that is modified based on the first stylesignal, the second style signal, and the third style signal. In anembodiment, the first, second, and third style signals operate atdifferent scales. Thus, the style modifications resulting from the firstand second style signals are retained in the fourth intermediate data.Spatial noise and/or a bias (not shown) may be inserted into the fourthintermediate data to produce the output data.

FIG. 8B illustrates a block diagram of a generator training system 800,in accordance with an embodiment. The generator training system 800 maybe implemented by a program, custom circuitry, or by a combination ofcustom circuitry and a program. For example, the generator trainingsystem 800 may be implemented using a GPU, CPU, or any processor capableof performing the operations described herein. Furthermore, persons ofordinary skill in the art will understand that any system that performsthe operations of the generator training system 800 is within the scopeand spirit of embodiments of the present invention.

The generator training system 800 includes a generator neural network820, such as the style-based generator system 100 including thesynthesis neural network 140 or 840, and a training loss unit 810. Thegenerator neural network 820 receives input data (e.g., at least onelatent code and/or noise inputs) and produces output data. Depending onthe task, the output data may be an image, audio, video, or other typesof data (configuration setting). The generator neural network 820 may beusing a training dataset that includes example output data that theoutput data produced by the generator neural network 820 should beconsistent with. The generator neural network 820 generates output datain response to the input data and the training loss unit 810 determinesif the output data appears similar to the example output data includedin the training data. Based on the determination, a set of parameters ofthe generator neural network 820 are adjusted.

When regularization is performed, the training loss unit 810 isconfigured to identify two points within the generator neural network820 and apply a first modification to a first point and compute a secondmodification for a second point. The second modification is consistentwith the first modification and a regularization loss is computed basedon the second modification. The set of parameters used by the generatorneural network are then updated to reduce the regularization loss. In anembodiment, the two points may include intermediate data and the outputdata. In an embodiment, the two points may include a style signal andeither intermediate data or the output data.

In an embodiment, a finite difference technique is used to compute thesecond modification by applying the first modification to the stylesignal or intermediate data at the first point and processing the firstmodified style signal or intermediate data by the subsequent layers ofthe generator neural network 820 to produce the second modification inthe intermediate data or output data the second point. In an embodiment,the first modification is a small random amount.

In an embodiment, a forward differentiation technique is used to computethe second modification by differentiating the intermediate data oroutput data at the second point with respect to a linear trajectory ofthe style signal or intermediate data at the first point, where thelinear transformation is defined by the first modification. In anembodiment, the linear trajectory is randomly selected.

Another smoothing regularization technique changes the output data torather than modifying the intermediate data or a style signal andpropagating the modification forward through the generator neuralnetwork 820. In an embodiment, the backward differentiation technique isused to compute the second modification by reversing the first andsecond points, so that the first point is downstream (in terms ofprocessing in the generator neural network 820) relative to the secondpoint. For the backward differentiation, an inner product (e.g., dotproduct) is computed between the intermediate data or output data at thefirst point and the first modification and the inner product isdifferentiated with respect to the style signal or intermediate data atthe second point to compute the second modification. For example, in anembodiment, a gradient vector may be computed as a dot product betweenthe output data and a random vector, differentiated with respect to theintermediate data or style signal.

The regularization is performed by repeatedly computing the secondmodification when the synthesis neural network 840 is being trained, andthen penalizing deviations in the magnitudes of the second modificationcompared with a reference value. The set of parameters (e.g., weights)are adjusted based on the deviations to increase uniformity of themagnitudes. The first point may correspond to the first style signal,second style signal, third style signal, first intermediate data, secondintermediate data, or the third intermediate data. The second point maycorrespond to the second intermediate data, the third intermediate data,the fourth intermediate data, or the output data. When backwarddifferentiation is used, the correspondences of the first and secondpoints are reversed.

FIG. 8C illustrates a flowchart of a method 825 for smoothingregularization for use in a generator neural network, in accordance withan embodiment. Each block of method 825, described herein, comprises acomputing process that may be performed using any combination ofhardware, firmware, and/or software. For instance, various functions maybe carried out by a processor executing instructions stored in memory.The method may also be embodied as computer-usable instructions storedon computer storage media. The method may be provided by a standaloneapplication, a service or hosted service (standalone or in combinationwith another hosted service), or a plug-in to another product, to name afew. In addition, method 825 is described, by way of example, withrespect to the generator neural network 820 of FIG. 8B. However, thismethod may additionally or alternatively be executed by any one system,or any combination of systems, including, but not limited to, thosedescribed herein. Furthermore, persons of ordinary skill in the art willunderstand that any system that performs method 825 is within the scopeand spirit of embodiments of the present disclosure.

At step 830, output data is generated by a generator neural networkbased on a set of parameters, where the generator neural networkcomprises one or more layers that each output features to a subsequentlayer of the one or more layers. In an embodiment, the generator neuralnetwork comprises one or more layers that each comprise a first layer120, a second layer 130, processing blocks 200 or 230, and/or styleblock 600, 640, 645, or 646. In an embodiment, the generator neuralnetwork includes the synthesis neural network 140 or 840. In anembodiment, generating the output data comprises computing the secondfeatures before computing the first features. In an embodiment, thefirst features are the output data and the second features are a stylesignal or intermediate data, so that the regularization is performedusing backward differentiation.

At step 835, first features associated with a first layer of the one ormore layers and second features associated with a second layer of theone or more layers are identified. In an embodiment, the first featuresare one of a style signal, intermediate data, and output data. In anembodiment, the second features are one of a style signal, intermediatedata, and output data.

At step 845, a first modification is selected with respect to the firstfeatures. In an embodiment, the first modification causes a change inthe first features. In an embodiment, selecting the first modificationcomprises selecting each component of the first modification randomly toproduce a Gaussian distribution of the first modifications.

At step 850, a second modification is computed with respect to thesecond features, where the second modification is consistent with thefirst modification. In an embodiment, computing the second modificationcomprises modifying the first features (e.g., style signal orintermediate data) according to the first modification to yield modifiedfirst features, re-computing the second features based on the modifiedfirst features to yield modified second features (e.g., downstreamintermediate data or the output data), and computing the secondmodification as the difference between the second features and modifiedsecond features. In an embodiment, re-computing the second featurescomprises processing the modified first features by one or more layersof the generator neural network to produce the modified second features.

When backward differentiation is used to perform regularization, thesecond modification may be computed by computing an inner productbetween the first features (e.g., downstream intermediate data or theoutput data) and the first modification and then differentiating theinner product with respect to the second modification.

At step 855, a regularization loss is computed based on the secondmodification. In an embodiment, the regularization loss is computed bythe training loss unit 810. In an embodiment, the regularization losscomprises a magnitude of the second modification. In an embodiment, theregularization loss comprises an L² norm function. In an embodiment, theregularization loss is computed by comparing a magnitude of the secondmodification against a reference value. In an embodiment, the referencevalue is a constant. In another embodiment, the reference value iscomputed as an average of the magnitudes over several executions of thegenerator neural network.

At step 860, the set of parameters is updated to reduce theregularization loss. In an embodiment, the set of parameters areweights, where different portions of the weights are applied to theactivations by the different layers in the generator neural network. Inan embodiment, updating the set of parameters brings the magnitudecloser to the reference value.

At a single point in the intermediate latent space, w∈

, the local metric scaling properties of the generator mapping g(w):

are captured by the Jacobian matrix J_(w)=∂g(w)/∂w. The point in theintermediate latent space may be the first features identified at step840 and may comprise a style signal or intermediate data associated witha layer of the generator. Motivated by the desire to preserve theexpected lengths of vectors regardless of the direction, a regularizerfunction for performing backward differentiation may be formulated as

(|J _(w) ^(T) y| ₂−α)²,  Eq. (5)where α is a reference value, y are modifications such as random imageswith normally distributed pixel intensities, and w˜ƒ(z), where thelatent vectors in latent space z are normally distributed. The randomimages may be generated by the style-based generator system 100 using arandom latent code to produce an initial image. A set of randomper-pixel Gaussian noise images may be used to define a set ofmodifications to the initial image. The noise images need not be used toactually modify the initial image.

To avoid explicit computation of the Jacobian matrix, the identity J_(w)^(T)y=∇_(w)(g(w)·y), which is efficiently computable using standardbackpropagation may be used. J_(w) ^(T)y comprises a secondmodification, corresponding to a modification of the style signal orintermediate data as a result of adding random noise y to the initialimage g(w). In an embodiment, a is a constant that is set dynamicallyduring optimization as the long-running exponential moving average ofthe lengths of a magnitude of the second modification |J_(w) ^(T)y|₂,allowing the optimization to find a suitable global scale by itself. Inan embodiment, the second modifications, products J_(w) ^(T)y arecomputed analytically. Equation (5) is minimized when J_(w) isorthogonal (up to a global scale) at any w. An orthogonal matrixpreserves lengths and introduces no squeezing along any dimension. Thus,the orthogonal matrix is associated with a uniform space.

Changes in the initial image g(w) resulting from the modification (e.g.,noise images) are computed as a dot product between the image and eachnoise image y in the set of noise images, g(w)·y. Assuming that theinitial image is modified based on each noise image, the dot productindicates how quickly the initial image moves in the direction of thenoise image. The noise image defines changes in the image space. Adirection of each change may be determined by computing a differencegradient (∇_(w)) of the dot product with respect to the intermediatelatent code w that is used to generate the style signals. The directionindicates the direction in which movement should occur in theintermediate latent space to maximize changes in the modified image. Thelength (magnitude) of the difference gradient indicates speed of thechange in the image with respect to the noise image for correspondingchanges in the latent space (e.g., second modifications) that are in thedirection of the difference gradient.

As shown in Equation (5), a magnitude of the second modification(difference gradient length) is compared with the reference length (a)and the square of the difference is a regularization penalty for aparticular choice of w and y that is computed during training. Thedifference gradients should converge toward being equal in length,thereby indicating that the transformation between the spaces is moreuniform. During training, variations in the difference gradient lengthsmay be penalized through a loss function to perform the smoothingregularization. When the regularization process is repeated for multiplechoices of w and y during training of the style-based generator system100 or the generator neural network 820, Equation (5) computes theaverage of the regularization penalty over the multiple choices that isminimized.

As the difference gradient ∇_(w)(g(w)·y), is somewhat expensive tocompute, a general optimization that applies to all regularizationtechniques may be used. Typically, the main loss function (e.g.,logistic loss) and regularization terms (e.g., R₁) are written as asingle expression and are thus optimized simultaneously. However, theregularization terms can be computed much less frequently than the mainloss function, thus greatly diminishing their computational cost and theoverall memory usage. For example, the R₁ regularization may beperformed only once every 16 minibatches without any drawback.Furthermore, training performance may also be improved as a result ofless frequent computation of regularization terms. In an embodiment,training with reduced frequency of the computation for a generatorneural network that implements weight demodulation is performed 40%faster at 61 images/sec compared with 37 images/sec implemented withoutweight demodulation and regularization.

Image quality issues, such as the artifacts 601, 603, and 605 shown inFIG. 6A, have been identified and restructuring the synthesis neuralnetwork to implement weight demodulation improves the quality. Theweight demodulation may also be applied to other generator neuralnetworks. Additionally, regularizing smoothness between intermediatedata output by two different layers (or stages) or between intermediatedata and the output image reduces image artifacts, such as the artifactsillustrated in images 7A. The regularization technique may be used incombination with weight demodulation or separately to improve theperformance of a generator neural network.

It is noted that the techniques described herein may be embodied inexecutable instructions stored in a computer readable medium for use byor in connection with a processor-based instruction execution machine,system, apparatus, or device. It will be appreciated by those skilled inthe art that, for some embodiments, various types of computer-readablemedia can be included for storing data. As used herein, a“computer-readable medium” includes one or more of any suitable mediafor storing the executable instructions of a computer program such thatthe instruction execution machine, system, apparatus, or device may read(or fetch) the instructions from the computer-readable medium andexecute the instructions for carrying out the described embodiments.Suitable storage formats include one or more of an electronic, magnetic,optical, and electromagnetic format. A non-exhaustive list ofconventional exemplary computer-readable medium includes: a portablecomputer diskette; a random-access memory (RAM); a read-only memory(ROM); an erasable programmable read only memory (EPROM); a flash memorydevice; and optical storage devices, including a portable compact disc(CD), a portable digital video disc (DVD), and the like.

It should be understood that the arrangement of components illustratedin the attached Figures are for illustrative purposes and that otherarrangements are possible. For example, one or more of the elementsdescribed herein may be realized, in whole or in part, as an electronichardware component. Other elements may be implemented in software,hardware, or a combination of software and hardware. Moreover, some orall of these other elements may be combined, some may be omittedaltogether, and additional components may be added while still achievingthe functionality described herein. Thus, the subject matter describedherein may be embodied in many different variations, and all suchvariations are contemplated to be within the scope of the claims.

To facilitate an understanding of the subject matter described herein,many aspects are described in terms of sequences of actions. It will berecognized by those skilled in the art that the various actions may beperformed by specialized circuits or circuitry, by program instructionsbeing executed by one or more processors, or by a combination of both.The description herein of any sequence of actions is not intended toimply that the specific order described for performing that sequencemust be followed. All methods described herein may be performed in anysuitable order unless otherwise indicated herein or otherwise clearlycontradicted by context.

The use of the terms “a” and “an” and “the” and similar references inthe context of describing the subject matter (particularly in thecontext of the following claims) are to be construed to cover both thesingular and the plural, unless otherwise indicated herein or clearlycontradicted by context. The use of the term “at least one” followed bya list of one or more items (for example, “at least one of A and B”) isto be construed to mean one item selected from the listed items (A or B)or any combination of two or more of the listed items (A and B), unlessotherwise indicated herein or clearly contradicted by context.Furthermore, the foregoing description is for the purpose ofillustration only, and not for the purpose of limitation, as the scopeof protection sought is defined by the claims as set forth hereinaftertogether with any equivalents thereof. The use of any and all examples,or exemplary language (e.g., “such as”) provided herein, is intendedmerely to better illustrate the subject matter and does not pose alimitation on the scope of the subject matter unless otherwise claimed.The use of the term “based on” and other like phrases indicating acondition for bringing about a result, both in the claims and in thewritten description, is not intended to foreclose any other conditionsthat bring about that result. No language in the specification should beconstrued as indicating any non-claimed element as essential to thepractice of the invention as claimed.

What is claimed is:
 1. A computer-implemented method, comprising:generating output data by a generator neural network based on a set ofparameters, wherein the generator neural network comprises one or morelayers that each output features to a subsequent layer of the one ormore layers; identifying first features associated with a first layer ofthe one or more layers and second features associated with a secondlayer of the one or more layers; selecting a first modification withrespect to the first features; computing a second modification withrespect to the second features, wherein the second modification isconsistent with the first modification and computing the secondmodification comprises; modifying the first features according to thefirst modification to yield modified first features; re-computing thesecond features based on the modified first features to yield modifiedsecond features; and computing the second modification as the differencebetween the second features and modified second features; computing aregularization loss based on the second modification; and updating theset of parameters to reduce the regularization loss.
 2. Thecomputer-implemented method of claim 1, wherein selecting the firstmodification comprises selecting each component of the firstmodification randomly.
 3. The computer-implemented method of claim 1,wherein the first modification is selected from a Gaussian distributionof random values.
 4. The computer-implemented method of claim 1, whereinthe generator neural network is a style-based generator neural network.5. The computer-implemented method of claim 4, wherein the firstfeatures are the output data and the second features are a style signal.6. The computer-implemented method of claim 4, wherein the firstfeatures are intermediate data and the second features are a stylesignal.
 7. The computer-implemented method of claim 1, wherein computingthe regularization loss comprises computing a magnitude of the secondmodification.
 8. The computer-implemented method of claim 7, whereincomputing the regularization loss further comprises comparing themagnitude against a reference value.
 9. The computer-implemented methodof claim 8, wherein the reference value is a constant.
 10. Thecomputer-implemented method of claim 8, further comprising computing thereference value as an average of the magnitude and additional magnitudesover several executions of the generator neural network.
 11. Thecomputer-implemented method of claim 8, wherein updating the set ofparameters brings the magnitude closer to the reference value.
 12. Thecomputer-implemented method of claim 1, wherein at least one of thesteps of generating, identifying, selecting, computing the secondmodification, computing the regularization loss, or updating isperformed within a cloud computing environment.
 13. Thecomputer-implemented method of claim 1, wherein at least one of thesteps of generating, identifying, selecting, computing the secondmodification, computing the regularization loss, or updating isperformed on a server or in a data center to generate an image, and theimage is streamed to a user device.
 14. The computer-implemented methodof claim 1, wherein at least one of the steps of generating,identifying, selecting, computing the second modification, computing theregularization loss, or updating is performed to generate an image usedfor training, testing, or certifying a neural network employed in amachine, robot, or autonomous vehicle.
 15. A computer-implementedmethod, comprising: generating output data by a generator neural networkbased on a set of parameters, wherein the generator neural networkcomprises one or more layers that each output features to a subsequentlayer of the one or more layers; identifying first features associatedwith a first layer of the one or more layers and second featuresassociated with a second layer of the one or more layers, whereingenerating the output data by the generator neural network comprisescomputing the second features before computing the first features;selecting a first modification with respect to the first features;computing a second modification with respect to the second features,wherein the second modification is consistent with the firstmodification; computing a regularization loss based on the secondmodification; and updating the set of parameters to reduce theregularization loss.
 16. The computer-implemented method of claim 15,wherein computing the second modification comprises: computing an innerproduct between the first features and the first modification; anddifferentiating the inner product with respect to the secondmodification.
 17. A system, comprising: a processor configured toimplement a generator neural network comprising one or more layers thateach output features to a subsequent layer of the one or more layers,wherein the generator neural network is configured to: generate outputdata based on a set of parameters; identify first features associatedwith a first layer of the one or more layers and second featuresassociated with a second layer of the one or more layers; select a firstmodification with respect to the first features; compute a secondmodification with respect to the second features, wherein the secondmodification is consistent with the first modification and computing thesecond modification comprises: modifying the first features according tothe first modification to yield modified first features; re-computingthe second features based on the modified first features to yieldmodified second features; and computing the second modification as thedifference between the second features and modified second features;compute a regularization loss based on the second modification; andupdate the set of parameters to reduce the regularization loss.
 18. Thesystem of claim 17, wherein selecting the first modification comprisesselecting each component of the first modification randomly.
 19. Anon-transitory computer-readable media storing computer instructionsthat, when executed by one or more processors, cause the one or moreprocessors to perform the steps of: generating output data by agenerator neural network based on a set of parameters, wherein thegenerator neural network comprises one or more layers that each outputfeatures to a subsequent layer of the one or more layers; identifyingfirst features associated with a first layer of the one or more layersand second features associated with a second layer of the one or morelayers; selecting a first modification with respect to the firstfeatures; computing a second modification with respect to the secondfeatures, wherein the second modification is consistent with the firstmodification and computing the second modification comprises: modifyingthe first features according to the first modification to yield modifiedfirst features; re-computing the second features based on the modifiedfirst features to yield modified second features; and computing thesecond modification as the difference between the second features andmodified second features; computing a regularization loss based on thesecond modification; and updating the set of parameters to reduce theregularization loss.
 20. The non-transitory computer-readable media ofclaim 19, wherein selecting the first modification comprises selectingeach component of the first modification randomly.